Question
A company develops a new Microsoft Dataverse plug-in that manages the Update message of an entity.
The plug-in logic requires access to the record columns before the operation starts and must compare the columns to post-update values.
You need to modify the design of the solution to access the information.
What should you do?
- A. Add the code to the plug-in to read the record from the InputParameters collection.
- B. Register a pre-image by using the Plug-in Registration Tool. Add the code to the plug-in to read the image from the PreEntityImages collection. Correct
- C. Register a post-image by using the Plug-in Registration Tool. Add the code to the plug-in to read the image from the PostEntityImages collection.
- D. Add the code to the plug-in to query the data from Dataverse by using the API call based on the record ID.
Explanation
A pre-entity image registered on the step gives the plug-in a snapshot of the column values as they were before the update, read from context.PreEntityImages, which can then be compared with the new values. InputParameters Target holds only the changed values being submitted, not the original ones. A post-image holds only values after the operation, so it cannot supply the before state. Querying Dataverse by record ID works but is slower than using an image, which the documentation recommends for exactly this comparison.