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

Comments

Popular posts from this blog

Filter Records on Item Lookup Through X++ - Ax 2012

How to Install Management Reporter in Ax 2012 R3

Settle Vendor Invoice/Payment through X++ code - AX 2012