D365FO – AX – Extends Data Entity method using Chain of Command

Extending a data entity with Chain of Command is the same as extending a table.

Create an extension class, use “ExtensionOf” attribute, call method and use Chain of command.

[ExtensionOf(tableStr(PurchPurchaseOrderHeaderV2Entity))]
final class Al0PurchPurchaseOrderHeaderV2Entity_Extension
{
    /// <summary>
    /// Extension method
    /// </summary>
    /// <param name = "_entityCtx"></param>
    /// <param name = "_dataSourceCtx"></param>
    public void mapDataSourceToEntity(DataEntityRuntimeContext _entityCtx, DataEntityDataSourceRuntimeContext _dataSourceCtx)
    {
        //your code here....
        next mapDataSourceToEntity(_entityCtx, _dataSourceCtx);

    }

}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s