A developer registers an assembly that contains a plug-in class and sets that plug-in type as the Plugin Type of a new custom API. A colleague says the developer must also register a step for the custom API message in the MainOperation stage, or the code will never run. How should the developer respond?
Select an answer to reveal the explanation.
Short Explanation
Setting the plug-in type on the custom API is the wiring; there's no extra switch to flip. You register the assembly, point the API at the type, and it runs every time someone calls the message. The trap is thinking you can register MainOperation steps yourself; you can't.
Full Explanation
A custom API's PluginTypeId column identifies the plug-in type that implements its main operation. When the API is invoked, Dataverse executes that type in the main operation stage of the event pipeline, so the developer only needs to register the assembly and set the plug-in type on the custom API. The custom API documentation states that the assembly must be registered but no step is required, and the Plug-in Registration Tool should not be used to set a specific step for the main operation. Developers cannot register steps in the MainOperation stage for any message; that stage is reserved for the core operation, which for a custom API is the linked plug-in type. Registering a PreOperation step would run the code before the main operation as an extension, if the API allows synchronous custom processing steps, and could run the logic twice when combined with the plug-in type. Execution is not limited to system administrators; callers need access to the custom API, and if ExecutePrivilegeName is set, they need that privilege, but no administrator role is implied. Exam caveat: the plug-in profiler cannot attach to the main operation, so debugging may require a temporary PostOperation registration. Operational check: call the custom API with a test client and confirm in the plug-in trace log that the type executed with stage value 30.