Skip to content

Trying to insert a Shop Order History record from a Custom Event triggered by a change on the same table throws a 'mutating table' error, and routing the insert through a background job (transaction_sys.deferred_call) instead runs into its own argument error — what's the correct way to create Shop Order History records from a Custom Event?

Answer

Use the dedicated Shop_Order_History_API.Generate method instead of calling the New__ method directly (or trying to defer the insert as a background job) — this is the standard, supported API specifically built for creating Shop Order History records, and it sidesteps both the mutating-table problem and the argument-handling issues that come from working around it with a deferred call.

← Browse Manufacturing and engineering questions