After a contract row is created in Dataverse, a plug-in must call a partner's REST API that sometimes takes many seconds to respond. Users must not wait for the call when they save, and the result is written back to the contract later. How should the developer register and code the plug-in?
Select an answer to reveal the explanation.
Short Explanation
If you don't want users tapping their feet, move the slow work to the async lane. The save finishes, the system job makes the call later. But async isn't a blank check: the sandbox still has a time limit, so cap that HTTP call's timeout too.
Full Explanation
An asynchronous step registered in PostOperation is queued as a system job after the core operation commits, so the user's save returns without waiting for the partner API. The plug-in then calls the API and writes the result back to the contract. Asynchronous plug-ins are still subject to the sandbox's execution time limit, so the code should set an explicit HttpClient timeout well inside that limit and handle failure, rather than letting a slow response end the job abruptly. Starting the call on a background thread from a synchronous plug-in is unsupported; Microsoft guidance warns against parallel execution and background threads in plug-ins, because the sandbox can terminate work that outlives the Execute call and the write-back may never happen. PreValidation runs outside the transaction, but it is still synchronous, so the user waits for the full HTTP round trip before the save completes. Plug-in steps have no configurable timeout; the execution time limit is fixed by the platform, so a slow partner cannot be accommodated by raising a step setting. Exam caveat: if the call can exceed the limit regularly, move the work to Azure Functions or a flow triggered by the event. Operational check: save a contract and confirm the form returns immediately, then confirm a succeeded system job and the written-back result.