Wednesday, January 12, 2022

How to update DEV environment version in D365 FO

 Go to DEV environment, download the update file from Asset Library



unzip the downloaded file in the following location "C:\D365FFOUpgrade\"

Open CMD in Admin mode

run following commands one by one

cd C:\D365FFOUpgrade


AxUpdateInstaller.exe generate -runbookid=upgrade -runbookfile=upgrade.xml -topologyfile=defaulttopologydata.xml -servicemodelfile=defaultservicemodeldata.xml


AxUpdateInstaller.exe import -runbookfile=upgrade.xml


AxUpdateInstaller.exe execute -runbookid=upgrade






NOTE: During the execution of Cleanup for data upgrade you may encounter an error: Stack trace: Call to TTSCOMMIT without first calling TTSBEGIN.\' on category \'Error\'.


To resolve this, re-run the step with this command: AxUpdateInstaller.exe execute -runbookid=upgrade -rerunstep=\<failed-step\>

Link

Tuesday, January 11, 2022

How to get display value from Ledger Dimension D365 FO X++

The argument (LedgerDimensionValue) is LedgerDimension which you can get from the table or any other source as per your requirement


info(strFmt("%1",LedgerDimensionFacade::getDisplayValueForLedgerDimension(LedgerDimensionValue))); 

Sunday, January 9, 2022

Loop through selected records of a grid using MultiSelectionHelper class in D365 FO

Multi-selection helper class

If a grid has the Multselection property enabled you can select more than one record.

If you want to programmatically loop through selected records just follow this code using MultiSelectionHelper class


void clicked() 

   InventItemGroup itemGroup; 

   MultiSelectionHelper helper = MultiSelectionHelper::construct();

   helper.parmDatasource(InventItemGroup_DS);

   itemGroup = helper.getFirst();

   while (itemGroup.RecId != 0)

   {

       info(itemGroup.ItemGroupId);

       itemGroup = helper.getNext();

   } 

}


Loop through selected records of a grid with MultiSelectionHelper class

Wednesday, January 5, 2022

Web.config file in D365 FO

 Go to :

K:\AosService\WebRoot

look for web.config file

search for following

<add key="DataAccess.Database"

<add key="DataAccess.DbServer"

<add key="DataAccess.SqlPwd"

<add key="DataAccess.SqlUser"


These are for DB, Server, and SQL password and SQL User


Microsoft

Link

Tuesday, January 4, 2022

Round off in D365 FO X++

Round off to 3 decimals: return decRound(total, 3);



More examples are below:

decRound(1234.6574,2) returns the value 1234.66.

decRound(1234.6574,0) returns the value 1235.

decRound(1234.6574,-2) returns the value 1200.

decRound(12345.6789,1) returns the value 12345.70.

decRound(12345.6789,-1) returns the value 12350.00.