If a job queue entry in Business Central interacts with an external system, like a payment gateway or shipping API, there's a common failure mode: the AL transaction might roll back after a successful external call. Within Business Central (BC), operations are wrapped in implicit transactions, meaning if an error occurs, all database changes are rolled back, but external HTTP calls remain unaffected. If these calls succeed before a local error in Business Central, this can lead to duplicate actions being performed externally. The solution involves using a stable idempotency key, like the outbox row's `SystemId`, to prevent duplicates. This key should be passed with each request, ensuring that if the request is retried, the external system recognizes and manages it as a duplicate, maintaining data integrity across platforms. Furthermore, handling deletions requires special consideration to manage both local and external copies of resources effectively.
Login now to access my digest by 365.Training