Posts

Write data to .txt file (X++)

Hi, in this write i will explain how to write specific data from a table to a ."txt" file with X++ code. In the job example below, you will see that we specify the file and folder location and then take permission to "write". Then we loop through "InventTable" data without any filters and write down the "ItemId" column. static void writeInventRecIdToTxtFile (Args _args) { InventTable inventTable; container reclist; TextIo file; int i = 0 ; Filename filename = @"C:\exampleFolder\example.txt" ; //Specify the path for folder and .txt file before runnig this job. FileIOPermission permission; # File ; try { permission = new FileIOPermission(Filename, "w" ); //Give permission to write in file. permission.assert(); file = new TextIo(filename, "w" ); //New file with the write mode. ...

How to do barcode in SSRS (X++)

Image
In ths post, i will explain how to do barcode in SSRS reports. - First of all you need to install barcode fonts into your reporting server and AOS server. Search for barcode fonts over internet and install them both of the servers and restart the machines. - After you return the dataset and started to your report design in Visual Studio; you need to write the field expression of the field with stars, that you want to be seen as a barcode. - Create a textbox and select your returning data. - Right click on the textbox and select TextBox Properties. In the properties menu, select Font and select "BC C39 3 to 1 HD Wide"  (You can select other barcode types also but this works for me generally). - After this, right click the TextBox and select "Expression" and write the field expression like below.

How to find Default Financial Dimensions (X++)

Hi, in this post i am goint to show you two ways of how to select default dimension values in AX 2012. 1) Traditional select codes:  You can do a "while select" or just "select firstonly" for your needs. You can get all dimensions with "while select"    and just one with the "select firstonly" as you know. But if you are going to use "select firstonly", you must specify the dimension attribute first. Let's assume that you need to find the default financial dimensions of a specific customer record; Select Firstonly: Below code shows you the Dimension Attribute name and value of the selected customer. CustTable custTable; DimensionAttributeValueSetItem DimensionAttributeValueSetItem; DimensionAttributeValue DimensionAttributeValue; DimensionAttribute DimensionAttribute; select firstonly custTable where custT...

Publishing SSRS Reports

Hi, in this article i will explain how to publish your SSRS reports to reporting server. - Start "Microsoft Dynamics AX 2012 Powershell" with admin privileges. Use below commands which is suitable with your situation; - " Publish-AXReport -ReportName YourReportName " >>  Publishes one specific report (Must be used on the Reporting Server) - " Publish-AXReport -ReportName * " >>  Publishes all SSRS reports located in the AX system. (Must be used on the Reporting Server) - "  Publish-AXReport -ReportName YourReportName   -servicesAOSName NameOfTheAOS -servicesWSDLPort WSDLPortofTheAOS " >> Publishes a report for a specified AOS name and WSDL port.

Parallel Compile X++

Hi, I'm going to explain how to parallel compile and why. In Dynamics AX you can compile all AOT with right click and compile, but this process took so long (Nearly 6 hours). Thats why we can use parallel compile to finish the process early. Here how it ca be done; 1) Windows => Run => cmd 2)   Change directory to " C:\Program Files\Microsoft Dynamics AX\60\Server\MicrosoftDynamicsAX\bin" 3) write the following command: "axbuild.exe xppcompileall /s=01 /w=03"  (s = AOS Id)   (w = number of processors) 4) Check the log file for errors.

How to read an Excel file

In this post, i will explain how to read an Excel file and write data from rows into AX system. Below job opens a dialog box and lets the user to select an excel file and then reads the excel starting from first row and transfers the cell data to a variable in Axapta. When the excel finished, application quits. static void readFromExcel (Args _args) { SysExcelApplication application; SysExcelWorkbooks workbooks; SysExcelWorkbook workbook; SysExcelWorksheets worksheets; SysExcelWorksheet worksheet; SysExcelCells cells; COMVariantType type; CommaIO comio; Container line; FileName filename; int row; ItemId exItemId; ItemName exItemName; Dialog dialog = new Dialog( "Select File and Path" ); DialogField DFPath; ; application...

How to find MainAccount with LedgerDimension (X++)

Hi, i will show you how to get the MainAccount record with the LedgerDimension. You can use "DimensionStorage" class to achieve this. Below code finds the whole Main Account record with a ledgerDimension RecId. DimensionStorage dimStorage; MainAccount mainAccount; MainAccount = DimensionStorage::getMainAccountFromLedgerDimension(ledgerDimension); //Parameter as the LedgerDimension RecId