Dynamics ax 365 display method

As we cannot create new method in exiting (Microsoft don't recommend overlayering) or extension table. We have to create extension class to add display method.

First you have to create extension and add display method in it.

public static class CustTable_Extension
{
  [SysClientCacheDataMethodAttribute(true)]
  public static display str customerGroup(CustTable_this)
 {
    CustTable custTable;

   select custTable
   where custTable.AccountNum== _this.AccountNum;

   return custTable.CustGroup;
  }
}

To use this method in form you have to set DataMethod as CustTable_Extension::customerGroup and CacheDataMethod as YES.

Comments

Popular posts from this blog

X++ Get Start Date and End Date of Month

Dynamics AX 365 : The name does not denote a class, a table or an extended data type

Error while setting server report parameters. Error message: The permissions granted to user are insufficient for performing this operation. (rsAccessDenied)