Skip to main content

Posts

Update record set using update_recordset in d365 F&O | AX 2012 using X++

Hello Devs! One the most common condition that we being a developer faces is to update existing records set that is mostly done on report level when we need to add new fields in the Temporary table and we don't wants to make extensions on class level. Here is a small piece of code that will assist you in updating existing record sets.  update_recordset custAgingReportTmp                 setting                 CMTCustInternalCollector = hcmWorker.PersonnelNumber,                 PaymDayId                         = custTable.PaymDayId,                 PaymTermId                       = custTable.PaymTermId,                 CashDisc      ...

Modify SSRS report using Post Event handler in x++ D365 F&O

Hello Devs! We often came across condition when we need to add certain fields in the out of the box report. One approach is to make changes on 'DP' class level and for that we need to create the extensions of related objects. Other approach is to create a post event handler of our report. Scenario: We need to add custom fields to the report.   Step #1: Create a new class that will be named according to Event handler in my case its "ATPCustAgingReportDPEventHandler" Step #2 : Copy the post event handler of the report to this class Step #3: Add the following code to it

Upload and Download file to BLOB storage Account in D365 F&O using X++

Hello Devs! This blog will be a source of help for many Devs who are working on Azure Blog Storage account. We normally use azure blob storage account to hold thing that need to be further processed and stored on cloud. Scenario:  We have been asked to * Upload file to azure * Download file from azure "We will be using Share File Management technique" Case #1 : Uploading File to Azure  Note : Here we are using  PurchParameter  table to extract urls and other folder related details you can use your own folder name to access the azure blob folder Further, Credential details have already been extracted i.e vault key,authorization key and has been stored in our custom table and extracted from d365 through azure parameters  storageCredentials  = new Microsoft.WindowsAzure.Storage.Auth.StorageCredentials(SystemParameters::find().CMTStorageAccountName, purchParameters.CMTTankKeyVaultSecret); Or alternatively, CloudStorageAccount storageAccount = ...

Find Original sales order of InterCompany sales Order in D365 using X++

Hello devs! Today we will be discussing on one of the most common requirement that developers encounter while working with Sales orders/Purchase order  or Inter-company Sales orders/Inter-company Purchase orders. Requirements: We need to pick the element related to original sales orders so we need to traverse from SalesOrder-->SalesOrder(inter-company)--> PurchaseOrder (inter-company) -->OriginalSalesOrder. For that i have written a peice of code to deal with the above requirement In my case I would be picking a TankID related to WRM .

Error : 9002 The Transaction Log for database 'DB' is full due to 'LOG_BACKUP' Sql Server Error in Event View for AX dynamics D365

This is one of the most common error faced by developers often working with database. This error is very much common for SQL servers as when the LOG size runs out in other words reaches 100% then we encounter this error. Being an AX developer, when the log usage reaches to 100% AX stops working and throw reconnecting request error. For this there is a rapid solution and i have written query for it. Step #1: --this could be use to check you Database log file name and its location use AxDB--in my case AxDB is my Database Name select * from sys.database_files Step #2: --This could be used to see you log space usage for your particular log DBCC SQLPERF (LOGSPACE) Step #3: --In my case Database log file name is D365DB_log --use this query to shrink your log file size USE AxDB; GO -- Truncate the log by changing the database recovery model to SIMPLE. ALTER DATABASE AxDB SET RECOVERY SIMPLE; GO -- Shrink the truncated log file to 1 MB. DBCC SHRINKFILE (D365DB_log, 1); G...

Date Filter using X++ AX 2012 and D365 F&O

One of the basic functionality that developer uses while using date filters. So here we will be using a helper funtion that will be catering all the conditions that has been linked with Date filter. Scenario : Here we are using the date set on DimensionAttributeValue to check its validity/Activity  public boolean validate()     {         DimensionAttributeValue dimensionAttributeValue;         boolean ret = super();         if (ret && this.DimensionAttributeValue)         {             dimensionAttributeValue = DimensionAttributeValue::find(this.DimensionAttributeValue);         }         if (dimensionAttributeValue)         {             if (dimensionAttributeValue.ActiveFrom != dateNull()                 ...

Report Name configured in Print Management settings D365 F&O using X++

In Dynamics AX, We being a developer has been asked by the client to display multiple reports set through Print Management. Free Text Invoice reports or Sales Order Confirmation and many other uses print management setups to call custom or OOTB reports so here below i have written query to find the report name setup on PMS(Print Management Settings). Helper functions written to find the report name and this could be easily used in extension class  public static SRSCatalogItemName reportNameCheck ()     {         PrintMgmtReportFormatName   printMgmtReportFormatName;         PrintMgmtReportFormat            printMgmtReportFormat;         PrintMgmtDocInstance              printMgmtDocInstance;         PrintMgmtSettings                     printMgmtSettings; ...