Saturday, October 22, 2022

D365 find Invent On Hand Value with X++

 D365 How to find Invent On Hand Value with X++ ?


To show on hand through D365 you can use On-hand list form from Inventory management >> Inquiries and Reports >> On-hand list



You can use Filter for your Item , and show Dimensions for more details 


Here You can check available Physical inventory qty, Available physical qty, Physical reserved qty ,Available physical on exact dimensions qty and Ordered in total qty



To get On-hand for item please find below the X++ code 
you can change parameters based on your business need 




 InventOnhand _InventOnhand;
        InventDimParm _InventDimParm;
        InventDim _InventDim;
        ItemId  itemid = "1030249-0174";

        _InventDim = null;
        _InventDim.InventSiteId  = "Main";
        _InventDim.InventLocationId = "X1";
        _InventDim.wMSLocationId = "ONM-ABQ-01";

        _InventDimParm.initFromInventDim(_InventDim);
        _InventOnhand = InventOnhand::newParameters(itemid , _InventDim , _InventDimParm);
        Info(strFmt("%1 , %2 , %3 , %4 : %5 " , 
            itemid ,  _InventDim.InventSiteId ,  _InventDim.InventLocationId , _InventDim.wMSLocationId
            , _InventOnhand.availPhysical()));



please find below the calculation for  _InventOnhand.availPhysical() 






































Monday, October 17, 2022

D365 F&O Install a deployable package from command line / Apply the latest platform update to environments

 

Install a deployable package from the command line

Go To deployable package folder and Open command as administrator 


Or Open Command as administrator >> 

Then, change directory to get into the folder with the unzipped files. : 

cd C:\AOTBrowser_DeployablePackage



Finally enter the following command to install the package. 

AXUpdateInstaller.exe devinstall






This process could save multiple hours to complete.

The system will deploy the files in the packages to the correct locations. As well as run scripts to update the database.

You can view the Microsoft documentation for this process here.


To Apply the latest platform update to environments

Download the latest platform from LCS >> Asset library >> Software deployable package


  1. Download the platform update package (AXPlatformUpdate.zip) to your virtual machine (VM).

  2. Unzip the contents to a local directory.

  3. Depending on the type of environment that you're upgrading, open the PlatformUpdatePackages.Config file under \AOSService\Scripts, and change the MetaPackage value.

    • If you're upgrading a development or demo environment that contains source code, change the MetaPackage value to dynamicsax-meta-platform-development.
    • If you're upgrading a runtime environment, such as a tier-2 sandbox environment or another environment that doesn't contain source code, the default value, dynamicsax-meta-platform-runtime, is correct.

     Note

    Step 3 is not applicable when upgrading to Platform update 4 or later.

  4. Follow the instructions for installing a deployable package. See Install deployable packages from the command line.

  5. If you're working in a development environment, rebuild your application’s code.

AXUpdateInstaller.exe generate -runbookid="OneBoxDev" -topologyfile="DefaultTopologyData.xml" -servicemodelfile="DefaultServiceModelData.xml" -runbookfile="OneBoxDev-runbook.xml"

    AXUpdateInstaller.exe import -runbookfile=OneBoxDev-runbook.xml

    AXUpdateInstaller.exe execute -runbookid=OneBoxDev




Sunday, October 16, 2022

D365 Database log Finance and Operations

 Database logging, also known as change tracking, in Dynamics 365 Finance and Operations is a very powerful security and audit tool that is surprisingly easy to setup. The database logging feature allows you to determine which table, and fields should be monitored and the events that should trigger the change tracking. 

I hope this article provided you with a full understanding of the capabilities and functionality of the database logging in Dynamics 365 Finance and Operations. The detailed information provided in the log should meet any auditor requirements for transparency and audit trails.

Setup

 first step is to define the tables and fields you want to track and to enable the database logging. When selecting tables to change track, think about the volume of database logs that may result from turning on database logging for a particular table. You may find that you can get what you need simply by using the created by, created date time, and modified date time fields that are found on most major tables. 

For this example, I am going to setup change tracking on the vendor bank account table on the account number field. The scenarios is that the auditors require a full audit trail for any changes made to any vendor bank account information. This is a real audit/security requirement I have had on a previous implementation. 

  • Navigate to System administration > Setup > Database log > Database log setup.


Click the “New” button.

This will open a wizard type form that we will click through. Click the “Next” button to proceed.




In this form we need to find the table and field we want to track. I prefer to show all tables and their system table names.




If you’re not sure of the table name and field you an find it by navigating to the form where you want to turn on change tracking and right click on the field you want to change track and click the “Form information” button and then click the “Form name” button. 

This will open a panel that will give you the table name found in the “Datasource” field and the field name found in the “Data field” field. In this example the table I am looking for is “VendBankAccount” and the field I am looking for is called “AccountNum”.



Under the “General ledger” tab we find the “VendBankAccount” table. Click the checkbox next to “AccountNum” and "BankIBAN" and click “Next”


Now I can scroll down and find the table and field I want to track and define which actions should trigger the logging. In this example I only want to track changes when someone updates a record so I will enable the “Update” flag and click “Next”.



In the next form you will see a summary screen letting you know what all will be enabled for database logging. Click the “Finish” button to finish the configuration.


Next we will go through and test what we have configured. 

Example

In this example we will take an already existing vendor with a vendor bank account already created and we will modify the account and view the database log that the system generates for the transaction. 

  • From the vendor record I will click the “Bank accounts” button in the “Vendor” tab in the ribbon.



Form here I will change the vendor bank account number 
from “1212212221222” to “33366663333333”.



1- Now to see the log for this we can navigate to Record Info > Database log on the Form

You can see in the “Overview” section the type of record that was changed, the type of change that occurred, who made the change, and when the change occurred.


You can see additional details by clicking the “History” tab. This tab gives you the current and previous value of the field.



 
2- Now to see the log for this we can navigate to System administration > Inquiries and reports > Database > Database log.




You can see in the “Overview” section the type of record that was changed, the type of change that occurred, who made the change, and when the change occurred.

You can see additional details by clicking the “History” tab. This tab gives you the current and previous value of the field.


Cleanup

As mentioned earlier in this article it is important to have a cleanup strategy in place for the database log to ensure the growth of the log does not dramatically affect performance.

  • You can do this by clicking the “Clean up log” button.


In the filter section you are able to set a date range based on the created date time of the database log record by clicking the “Filter” button . So, you could use a dynamic query range of (DayRange(-999,-365)) to delete all database log records older than one year.




You could also set the recurrence to run weekly or monthly and run over the weekend. When the cleanup job runs it will delete any database log record that falls within the specified query.

Ref

I hope this article provided you with a full understanding of the capabilities and functionality of the database logging in Dynamics 365 Finance and Operations. The detailed information provided in the log should meet any auditor requirements for transparency and audit trails.