PL 400 Plugin Development 2 — Questions and Answers
Question 1: Which interface must a Dataverse plugin class implement?
- IPlugin (Correct answer)
- IWorkflow
- IServiceProvider
- IOrganizationService
Correct answer: IPlugin
Every Dataverse plugin must implement the IPlugin interface, which exposes the Execute method.
Question 2: What is the purpose of the ITracingService in plugin development?
- Sending trace logs to Azure Monitor
- Writing diagnostic messages retrievable via Plugin Trace Log (Correct answer)
- Logging errors to the Windows Event Viewer
- Streaming real-time telemetry to Application Insights
Correct answer: Writing diagnostic messages retrievable via Plugin Trace Log
ITracingService.Trace() writes messages to the Plugin Trace Log, which developers can view in the maker portal for debugging.
Question 3: A plugin registered in Sandbox (isolation mode) attempts to call an external web service. What happens?
- The call succeeds if the URL is in the allowed list
- The call always fails with a SecurityException (Correct answer)
- The call succeeds but is rate-limited
- The call is queued and executed after the transaction
Correct answer: The call always fails with a SecurityException
Sandbox-isolated plugins cannot make outbound network calls; they throw a SecurityException when external HTTP access is attempted.
Question 4: When registering a plugin step, what does setting the Execution Order to 1 versus 2 control?
- Which pipeline stage the plugin runs in
- The relative firing sequence when multiple plugins target the same event (Correct answer)
- Whether the plugin runs synchronously or asynchronously
- The number of retry attempts on failure
Correct answer: The relative firing sequence when multiple plugins target the same event
Execution Order determines the sequence in which multiple plugins registered on the same message/stage fire, with lower numbers firing first.
Question 5: Which method on IOrganizationService should you use to run multiple operations atomically within a plugin?
- ExecuteMultiple
- ExecuteTransaction
- Execute with an ExecuteTransactionRequest (Correct answer)
- Batch
Correct answer: Execute with an ExecuteTransactionRequest
ExecuteTransactionRequest wraps multiple operations so they all succeed or roll back together within a single transaction.
Question 6: What entity snapshot is available in the plugin execution context when a plugin fires on the Update message?
- PreEntityImages only
- PostEntityImages only
- Both PreEntityImages and PostEntityImages depending on registration (Correct answer)
- Neither; only the Target attribute is available
Correct answer: Both PreEntityImages and PostEntityImages depending on registration
Pre- and post-entity images are both available for Update, but only if explicitly registered on the plugin step before deployment.
Question 7: A developer wants to prevent a record from being deleted based on business logic inside a plugin. What is the correct approach?
- Return false from the Execute method
- Throw an InvalidPluginExecutionException (Correct answer)
- Set context.OutputParameters['Cancel'] = true
- Call context.AbortPipeline()
Correct answer: Throw an InvalidPluginExecutionException
Throwing InvalidPluginExecutionException aborts the operation and surfaces the message to the user as a business error.
Which interface must a Dataverse plugin class implement?