Wednesday, 16 August 2017

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:
1
2
3
4
5
6
7
8
9
public static class MyCustTable_Extension
{
    [SysClientCacheDataMethodAttribute(true)] //This attribute will cache your display method.
    public static display Name myDisplayName(CustTable _this)
    {
        return _this.nameAlias() + "myDisplayName"; //Do here your display method as usual.
    }
 
}
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

Foreign currency revaluation currencies not showing in drop down in dynamics 365 finance & Operations 8.0

In the previous versions you can see all currency codes in the currency drop down, but Dynamics 365 finance and operations 8.0 you don'...