PL 400 Plugin Development 5 — Questions and Answers
Question 1: What happens to an asynchronous plugin if the Dataverse async service is restarted while the plugin is queued?
- The plugin execution is permanently cancelled
- The system message is lost and must be manually requeued
- The async service replays the message from the queue after restart (Correct answer)
- The plugin runs synchronously as a fallback
Correct answer: The async service replays the message from the queue after restart
The asynchronous queue is durable; the async service replays pending system jobs after a restart so no messages are lost.
Question 2: Which execution context property provides the unique identifier of the pipeline event that triggered the plugin?
- context.CorrelationId (Correct answer)
- context.RequestId
- context.OperationId
- context.MessageName
Correct answer: context.CorrelationId
CorrelationId is a unique GUID assigned to the entire pipeline execution chain and can be used to correlate logs across multiple plugins.
Question 3: A plugin throws an unhandled exception that is NOT an InvalidPluginExecutionException. What behavior should a developer expect?
- The operation completes successfully and the exception is logged silently
- Dataverse rolls back the transaction and shows a generic error to the user (Correct answer)
- The exception is swallowed and the pipeline continues
- Dataverse retries the operation up to three times before failing
Correct answer: Dataverse rolls back the transaction and shows a generic error to the user
Any unhandled exception causes Dataverse to roll back the transaction and surface a generic error, unlike InvalidPluginExecutionException which shows the developer's message.
Question 4: In the context of custom API development in Power Platform, how does a Custom API differ from a traditional plugin on the Execute message?
- Custom APIs support sandboxed execution while Execute plugins do not
- Custom APIs expose a named endpoint with defined input/output parameters and can be triggered from flows or client code (Correct answer)
- Custom APIs run in the Pre-Validation stage; Execute plugins run Post-Operation
- Custom APIs are asynchronous only; Execute plugins can be synchronous
Correct answer: Custom APIs expose a named endpoint with defined input/output parameters and can be triggered from flows or client code
Custom APIs let developers define typed input/output parameters and expose a discoverable action endpoint, unlike generic plugin steps on Execute.
Question 5: What must a developer do to make a plugin step fire for ALL fields during an Update, rather than only when specific fields change?
- Set Execution Mode to Asynchronous
- Leave the Filtering Attributes field blank (Correct answer)
- Set Execution Order to 0
- Register the step on Pre-Validation instead of Pre-Operation
Correct answer: Leave the Filtering Attributes field blank
Leaving Filtering Attributes empty means the plugin fires on every Update regardless of which fields are included in the payload.
Question 6: Which Dataverse service should a plugin use to impersonate another user when performing data operations?
- IOrganizationServiceFactory.CreateOrganizationService(targetUserId) (Correct answer)
- IOrganizationService with a custom header
- context.InitiatingUserId property setter
- OrganizationServiceProxy with alternate credentials
Correct answer: IOrganizationServiceFactory.CreateOrganizationService(targetUserId)
Calling CreateOrganizationService with a specific userId creates a service instance that impersonates that user for all subsequent operations.
Question 7: A developer needs to read the original field values before an Update in a plugin. Which entity image type should be registered on the step?
- PostImage
- PreImage (Correct answer)
- DeltaImage
- SnapshotImage
Correct answer: PreImage
A PreImage captures the record's field values as they existed in the database before the Update operation executed.
What happens to an asynchronous plugin if the Dataverse async service is restarted while the plugin is queued?