Posts

Showing posts from December, 2024

Extracting Project Addresses to Excel in Dynamics AX 2012

 In this blog, I’ll demonstrate how to extract project address details into an Excel file using X++ in Dynamics AX 2012. While CSV is a great format for small-scale data export, it has limitations when dealing with large datasets, as it lacks the concept of multiple sheets. To overcome this, I transitioned to Excel, which supports multiple sheets and can handle larger volumes of data seamlessly. Why Excel Instead of CSV? In my previous implementation, I used a CSV format to extract project addresses. While it was simple and effective for smaller datasets, it became evident that: CSV files are single-page only : If the record count exceeds the limit, we cannot paginate to a new sheet. Excel offers better structure : With multiple sheets, we can organize and store large amounts of data efficiently. Usability : Excel files are more user-friendly, especially when filtering, sorting, or visualizing data. X++ Job for Exporting Project Addresses to Excel Below is the X++ code to extract p...

How to Extract and generate a CSV File and Retrieve a List of Project Addresses in AX 2012 Using SQL and X++

In this post, I will share how to retrieve a list of project addresses in Microsoft Dynamics AX 2012 using both SQL queries and an X++ job. This guide includes both approaches to ensure flexibility depending on your requirements. Background and Requirement A client required a report listing all the addresses associated with projects in AX 2012. To fulfill this, I identified the necessary tables and their relationships to retrieve the relevant data. The key tables involved are: ProjTable : Stores project-related data. LogisticsLocation : Stores location details. LogisticsPostalAddress : Stores postal address details. LogisticsAddressCountryRegion : Stores country/region information. After confirming the relationships between these tables, I wrote a SQL query to extract the required data and later implemented an X++ job to automate the extraction process into a CSV file. SQL Query for Project Addresses Here is the SQL query I used to fetch the project addresses: SELECT     ...