Skip to content

A persistent custom field tracks which Sales Manager is currently assigned to a Salesman, and a second custom field on Customer Order is meant to record that Sales Manager's ID at the moment an order is released, so it can be reported on historically even if the Salesman's manager assignment later changes. A Custom Event built to copy this value across on release fires without error but never actually updates the target field. Where's the issue, and what's a working approach?

Answer

A live Reference-type field pointed at the current Sales Manager assignment would only ever show whichever manager is CURRENTLY assigned, losing the historical point-in-time value entirely if the assignment later changes — which defeats the actual goal of capturing a snapshot at release time. Instead of trying to write this from a same-transaction event on the order itself, trigger a Custom Event on CustomerOrderHistory specifically, filtered to the exact history entry representing the Release transition, matching both the history state and message text to 'Released' — look up the relevant Sales Manager value at that specific moment, and write it into the persistent custom field using the framework's own attribute-based custom-field update call (a Cf_Modify__-style API call passing the looked-up value as a Client_SYS attribute). Triggering off the history record created after the release transaction actually commits, rather than within the same transaction the order itself is being released in, is what makes this reliably capture the value at that specific point in time.

← Browse Workflows and automation questions