PL-400 practice question 31 of 35
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?
Full set: 391 questionsDomain Extend the platform
To access a record's column values as they were before an update operation, the standard and most efficient method is to use a pre-entity image. A pre-entity image is a snapshot of the record taken before the main database transaction occurs. By registering a pre-image for the Update message step, the plug-in's execution context will be populated with this snapshot. The plug-in code can then access this snapshot from the IPluginExecutionContext.PreEntityImages collection to retrieve the pre-update values for comparison against the new values.
A. The InputParameters collection's Target property for an Update message only contains the specific attributes that are being changed, not the full record state before the operation.
C. A post-image is a snapshot of the record after the main operation has completed. It provides post-update values, not the pre-update values required by the scenario.
D. Querying Dataverse via an API call within the plug-in is inefficient. It introduces extra latency and API consumption, whereas entity images provide the same data directly within the execution context.
1. Microsoft Docs, Dataverse > Developer > Use entity images with plug-ins:
Section: "Pre-entity image": "This is a snapshot of the entity before the core platform operation. We also call this the 'before' image... You can access this image in your code from the IPluginExecutionContext.PreEntityImages property." This directly supports using a pre-image to get the "before" state.
Section: "Register an image": This section details the process of using the Plug-in Registration tool to configure a pre-image for a specific plug-in step, confirming the procedure described in the correct answer.
2. Microsoft Docs, Dataverse > Developer > Event framework:
Section: "Event execution pipeline": This document explains the plug-in pipeline stages. It clarifies that for an Update message, the Target parameter in the InputParameters contains an Entity instance with only the properties being updated, which supports why option A is incorrect.
Section: "IPluginExecutionContext": The documentation for the execution context explicitly lists the PreEntityImages and PostEntityImages collections as the means to access snapshots, reinforcing that this is the intended design pattern.
Keep practicing
Take the free PL-400 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other PL-400 practice questions
- Question 4You are designing a one-way integration from Microsoft Dataverse to another system. You m…
- Question 6You need to configure the trigger for account records. Which expression should you use?
- Question 8You are building a custom application in Azure to process resumes for the HR department. …
- Question 12You need to add the script to populate event data on the form. Which code segment should …
- Question 14A company plans to create an order processing app. When orders are created, the app will …
- Question 15You are creating a model-driven app. You create JavaScript code to display a message when…
