Plugins: Image or Retrieve Entity RRS feed

  • Question

  • When a plugin is executed the entity that is being passed in always contains the Id. Let's say that I need access to a reference ID in that entity, e.g. CustomerId for a SalesOrder record. There are two ways I can get the CustomerId. One is including a post image or pre image. The other one is taking the Id from my SalesOrder that is being Created/Updated/Deleted and retrieve it. Of course this assuming the plugin is running post-operation for create and pre-operation for delete.

    My question is what is better. The advantage of retrieving the additional attributes in my code is that I don't need to worry about images (not that it is a big issue). Are there any disadvantages going that route, e.g. slower, etc?

    Thursday, December 12, 2013 8:38 PM