Skip to main content

D365 FO: Method calling sequence of Data Entity


1.       The postLoad method is called also by import! Since postLoad is the recommended place to set values for the virtual fields, this potentially slow-down the import process unnecessarily.

2.       Be careful by using the postTargetProcess method! This method is called at the end of EACH thread/task-bundle if you are using the “Import threshold record count” option.

3.       Previously, you could add postTargetProcess only to a newly created entity, but now you can extend any entity using CoC

Extension is simple.

[ExtensionOf(tableStr(DataEntity))]
final public class DataEntity_Extension
{
    public static void postTargetProcess(DMFDefinitionGroupExecution _dmfDefinitionGroupExecution)
    {
        // Do no call next
        //logic here
    }
}

Please note that this cannot be done via ODATA because ODATA updates, inserts records row by row and there is no post event\method to use. (*Thanks to Uwe krueger for the insight*)

Comments

  1. Thanks for sharing such a wonderful Post with us. I learnt alot from your post. I am appreciating from you to you will share more information about it. Please keep sharing. Thanks Alot
    Best HP Service Center in Ameerpet, Hyderabad.
    Best Laptop Service Center in Ameerpet, Hyderabad.

    ReplyDelete

Post a Comment