How to Resolve Plug-In Errors When Using Early-Bound Classes in Dataverse?
Table of Contents
Question
You build a plug-in for a Microsoft Dataverse table update that appends the name of a row with its status. You use early-bound classes.
You register the step on PreOperation and filter the step on the following columns:
- primary column
- statecode
- statuscode
The plug-in runs twice when the primary column and the status reason of a row is changed.
The plug-in returns an error on the second run.
You need to resolve the error.
What should you do?
Select only one answer.
A. Use the late-bound Entity class.
B. Remove the filter on statuscode.
C. Change the stage of the step to PostOperation.
D. Store the value of the primary column in a shared variable.
Answer
D. Store the value of the primary column in a shared variable.
Explanation
This item tests the candidate’s knowledge of registering plug-in components by using the Plug-in Registration Tool.
When an update contains state/status columns and other columns, a plug-in registered on update of the table row at either the PreOperation or PostOperation stage will run twice. The first run is for the non-state/status columns, and the second run is for the state/status columns. The context will not contain the values for the other columns. The second plug-in will cause an error because the context does not contain the primary column. To solve the error, the primary column should be stored in a shared variable so that it is available in the second run.
Changing the stage of the step to PostOperation will not prevent the error. Statecode and statuscode are dependent upon each other, and the system will use the default statuscode for the statecode. Using early-bound classes or the late-bound Entity class will not affect how the plug-in is run.
Microsoft Power Platform Developer PL-400 certification exam practice question and answer (Q&A) dump with detail explanation and reference available free, helpful to pass the Microsoft Power Platform Developer PL-400 exam and earn Microsoft Power Platform Developer PL-400 certification.