Why your Business Central job queue needs idempotent external effects when integrating external systems.


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.


Article 2w

Login now to access my digest by 365.Training

Learn how my digest works
Features
  • Articles, blogs, podcasts, training, and videos
  • Quick read TL;DRs for each item
  • Advanced filtering to prioritize what you care about
  • Quick views to isolate what you are looking for right now
  • Save your favorite items
  • Share your favorites
  • Snooze items you want to revisit when you have more time