Skip to main content

Posts

Showing posts from July, 2018

Using macro in query as condition in D365 finance and operations

Those who are familiar with the macro in ax will know that the macro's are used when the user/system should not be able to change the value.The values should remain constant. In finance and operations we can define macro and use it in the select query. For this example create a macro with below condition in it. Here i have created #CustomerBlocked with below condition. %1.Blocked ==  CustVendorBlocked::All Now we will be using the macro in the code. For this create a runnable class called BlockedCustomer. Below is the code for the class. class BlockedCustomer {           public static void main(Args _args)    {             CustTable       custTable;      while select custTable             where #CustomerBlocked (custTable)      {       info(strFmt("%1 - %2",custTable.AccountNum,custTable.name()));      }    } } Happy daxing!!!