Tuesday, 3 July 2018

How to block inventory in ax D365 / AX7

In Dynamics AX if we want to block inventory for certain item, we have an out of the box form which caters this need and blocks the inventory.














Now the impact of any inventory blocking for an item can be observed in the 'On-hand inventory' :






































We take a test item T1001. Currently the situation of On-hand inventory has 4 reserved quantity and we would like to block more inventory.

We simply add a record in the Inventory blocking screen mentioned before:











After creating a record with quantity 5, our on-hand inventory will reserve 5 quantity for this item:









Now if we want to unblock the inventory we simply update the quantity.
For example we want to unblock 2 quantity out of 5 that we blocked. So we update the blocking quantity to 3:











Following impact will be on our on-hand inventory now:









To do this by code, we simply create a table record for InventBlocking table:


Thursday, 28 June 2018

Some basic methods for Dimensions in LedgerDimensionFacade class in D365 / AX7

In Dynamics 365 FO , Microsoft has introduced few more classes to help us with the Dimension related requirements. Here are few name of classes and method that can be used.


1. LedgerDimensionFacade:



















This class has multiple methods that cater to different requirements. We discuss a few in the following:

For instance the most common operation that is required is to merge a Ledger dimension and a Default dimension:



















We have two recIds of default and ledger and dimensions, and we want to merge the two dimensions value into one ledger dimension

















We have a combined ledger dimension now.

Also there is another class that holds a few more methods for DefaultDimension operations:


2. LedgerDimensionDefaultFacade: 










This class will help us to perform action over default dimension. Like Merge specific default dimensions into single default dimension, replace attribute value etc.

Wednesday, 13 June 2018

Using entities to export data to custom database (BYOD) in AX7 / D365

This topic explains how administrators can export data entities from Microsoft Dynamics 365 for Finance and Operations into their own Microsoft Azure SQL database. This feature is also known as bring your own database (BYOD). 

We start by starting with the following steps:

Create your custom database in SQL























Create Login for the DB created























Assign DB to the created login























Now go to Data Management in AX.





































Next go to Configure Entity export to database







































Now click on Validate. You will receive following error initially












To resolve this follow the following steps:






















Now validate again


Now click Publish.











Select The entity that you want to use for data export













Now create an export project for the entity you have published



























Export data through this entity and the data will be dumped into your custom database

Tuesday, 16 January 2018

How to check custom validation on purchase order confirmation event in AX7 / D365

There are scenarios where we need to do some custom validations on the purchase order while we try to confirm the PO.
In AX7 / D365 we can use the pre-post events in order to achieve our goal.

For the purpose of validation on purchase order confirmation we use the following event :






The reason of using post event handler of method "validate" of class PurchFormLetter_PurchOrder is that the system runs its default validations first and then we check for our custom validations.

The "validate" method of class PurchFormLetter_PurchOrder is generic, so we first need to capture if the flow of the code occurs from the confirmation class of the purchase order:








Now we do our validations in this "if " check and we need to stop the confirmation of PO in case of failure of our custom validations:











and in case of successful custom validations :


How to block inventory in ax D365 / AX7

In Dynamics AX if we want to block inventory for certain item, we have an out of the box form which caters this need and blocks the inventor...