Tuesday, 27 February 2018

Explore metadata search feature in Visual Studio (AX7 / D365)

It is often necessary to find things in the code or to find artifacts. Often times you may not know the name of the metadata element that contains your desired code. Now in AX7 / D365 we can use the Metadata Search tool to perform a complete and faster search in your Application object tree elements.

You can access the Metadata search tool window from the Dynamics 365 > Metadata Search menu command. 













By using this feature we can use different types of filters in Visual studio to search our relevant code. You can double-click any result line to navigate to  the corresponding X++ code or metadata that matches your search query.


  • Code: – search for a specific code.
  • Type: – filter the elements by type.
  • Model: – filter the elements by model.
  • Name: – filter the elements by name.
  • Property: search for element with the property with the specific value.

























Note: Make sure there should not be any space in between Type values otherwise it will show "Invalid query" error.







Thursday, 22 February 2018

Using Delegates in AX7 / D365

Delegate methods serve as a means for defining a contract between the delegate instance and the delegate handler. They are widely used by Microsoft to create customization points for customers and partners. It can be very helpful when we want to call something from Model-A in Model-B but we cannot due to referencing. So in this scenario we can use delegates for accessing the artifacts.

Step: 1
Create a delegate method.

Step: 2
Create a subscriber to your delegate method.







Step: 3

Invoke your delegate.










Reference: 
AX 7. Breaking dependencies

Thursday, 8 February 2018

Validate Reservation Hierarchy on Validate event in AX7 / D365

Reservation hierarchy is based on the storage and tracking dimensions of items, such as inventory status and license plate. In this blog I will show you how you can validate reservation hierarchy while having storage and tracking dimension. Please see below screen shots of validate methods.










Validate warning is shown below:

Wednesday, 7 February 2018

How to get the OOTB Form Object and its methods in Pre / Post Events in AX7 / D365

Recently I came across a scenario on which calling from a specific menu item I need to pre-populate some fields on product creation form . When I did some research I found in EcoResProductCreate form that there are already written parm methods in which all I need to do is to pass my value and let parm method do the rest. But for that I need to get the form object and its methods. To achieve this there are two options :
1- Use chain of command
2- Use Event Handlers

In this blog I have used event handler technique. Please see the below screen shot.

Note: When you assign form object to your initialized object, there will be no intellisense shown. So for that you need to explicitly write your desired method.







How to Get Customer Free Text Invoice "Totals" form field value with X++ in D365FO

Customer free text invoices are an essential aspect of financial management in D365FO. In this blog, I have compiled all the code needed to ...