PostLoad' method of Data entity in Dynamics 365 for finance and operations


I have seen lot of developers using 'PostLoad' method to implement most of their business logic related to integrations.

But, if you are writing any logic that is specific to the export process.
For ex: Setting any flags after export, or initiating any process after the export is done and so on.

We have to keep in mind that entities are not just used for Asynchronous but also for Synchronous scenarios.
The PostLoad() method will be executed every time the data is loaded.
For ex: 
1) When that particular data entity is opened through 'Open in excel'/Excel       Addin feature.
2) Whenever there is an get request against that entity
 - A simple 'Get' request from browser or any other tools.
   (Through the Odata endpoint -https://[Base URL]/data/'YourEntity') 
 - Use of 'Odata feed' in Excel or any other tools.

So we have to ensure that, there will not be any such logic written, which would be executed unnecessarily.

Comments