最新消息:ww12345678 的部落格重装上线,希望大家继续支持。

D365 – 数据实体方法调用顺序 / D365 – Data Entity Method Call Sequence

网络文摘 William 2482浏览 0评论
Thanks to Uwe Kruger for sharing this. I keep it here for my own reference. My notes:
  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 can be done only MDM scenarios but not via ODATA because ODATA updates, inserts records row by row and there is no post event\method to use. You might wish to use OData action to perform post actions on records.

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址