Study FAQ
How can a Dataverse custom API return the same business result when a caller retries?
Also asked as 2
- How do I make a state-changing Dataverse custom API safe to replay after a lost response?
- How should a Dataverse custom API recognize a repeated request and return its recorded result?
Answer
Have the custom API accept a stable logical request identifier and store its association with the caller's operation, target and recorded business result. On a valid replay, return that recorded result and make it clear whether this invocation changed state. A typed GUID parameter provides a place to carry identity. The implementation must enforce uniqueness and make the state transition and result recording consistent under concurrent requests. Dataverse custom API parameters and results · Dataverse alternate keys
For a release action, a caller can retain RequestId after losing the response. Define ReleaseId as the durable release identity, and use Changed=false for a successful replay of that existing result. Reject reuse of the same request key for a different target or business payload. Return a controlled failure for an ineligible or unauthorized release. When both Dataverse writes must succeed together, use the same supported standard-table pipeline transaction and verify transaction participation with IsInTransaction and a forced error. Avoid batch wrappers such as ExecuteTransactionRequest inside plug-in code. An external write needs its own recovery contract if it can succeed before local failure. Dataverse event framework · Avoid batch requests in plug-ins
In a development environment, send the same authorized request twice, repeat it concurrently and repeat it with a different target. After losing an otherwise successful response, recover by the original ID. Confirm that the accepted calls refer to the same durable result and that only one business transition exists.
Full explanation
AB-400: Custom APIs, Business Events and Plug-in Identity
Study guide · AB-400
Read the full explanation