Saturday, 17 March 2018

Inventory blocking through x++ code in AX7 / D365

Recently I have came across a requirement in which I needs to block the inventory through inventory blocking process. After little bit of research I have develop the job which can achieve my desired requirement. 

Thursday, 15 March 2018

Error more than one form was opened at once for the lookup control in D365

In D365 when we use OnLookup event handler for overriding existing lookup implementation by adding new columns or adding new ranges an error occurred "More than one form was opened at once for the lookup control".

This error occured because OnLookup Event it calls super() (base method) and on same time both the lookup opens. The resolution of this error is simple all we need to do is to cancel super call as shown in screenshot.

Error:











Solution:







Monday, 12 March 2018

Custom lookup using OnLookup Event Handler in AX7 / D365

To create a lookup on a control (e.g. StringEdit control), override the lookup method or copy the OnLookup event handler of that control. Below is the example of the custom lookup using OnLookup Event Handler in AX7 / D365.


Cancel OOTB validation on data field and field control events in AX7 / D365

In AX7 / D365 like tables, form controls and other element types, form data sources and form data source fields provide framework-level events. Validation events on data field and field controls support invalidating the user-specified values. The following example shows how you can cancel or override validating values on Validate events of form field control or of data fields.

Form data field validation:




From control field validation:




Monday, 5 March 2018

Use of .Net Web Browser control in AX2012 & AX7 / D365

In AX2012 & AX7 / D365 we can use WPF or in general .net controls. Microsoft made a great effort to integrate the .NET environment and AX, not only from a run-time perspective but also for developers, easy event handling and so on. In this example I have add web browser control pro-grammatically and will try to Navigate Website through web  browser control.











Reference: Tutorial: WPF User Control for AX2012

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

Get Parent Position Worker Name from Current Worker Position | D365FO X++

In this blog, we explore how to fetch the Parent Position Worker from a Current Worker Position in D365FO. The solution revolves around c...