Monday, March 14, 2022

D365 F&O : DISPLAY METHOD ON TABLE EXTENSION

 On Dynamics 365 for Operations 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
{
//This attribute will cache your display method.
    [SysClientCacheDataMethodAttribute(true)]
    public static display Name myDisplayName(CustTable _this)
    {
//Do here your display method as usual.
        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


Ref

No comments:

Post a Comment