Monday 22 August 2016

AX7 : DISPLAY METHOD ON TABLE EXTENSION



On AX7 we don’t have the option to create methods on table extension, so we should use the extension class to do that. The example below will show how to create a display method on the table extension class and use on a form extension.

First create your table extension class and your display method following the example below:
public static class MyCustTable_Extension
{
[SysClientCacheDataMethodAttribute(true)] // optional
public static display Name myDisplayName(CustTable _this)
{
     return _this.nameAlias() + "myDisplayName";
}

}
To use your display method on the form, create your new field on the form extension and use the property as below:
Capture
To cache your display method on the form set on the field the property “Cache Data Method” = yes if you don’t want to use the Attribute above.
Capture2

No comments:

Post a Comment