In business rules on the Location table, previous is the same as current
For After business rules on the Location table [cmn_location] table with an order of 100 or higher, "previous" is the same as "current."
Steps to reproduce
- Log in to a Fuji instance.
- Create a business rule:
- Table: Location [cmn_location]
- When: After
- Update: true
- Order: 100
- Condition: current.contact.changes()
- Script: gs.log("Contact field has been updated");
- Navigate to a Location record.
- Update the Contact field.
- Navigate to the system log.
Note that the message was not recorded.
The business rule fails to run because "previous" is the same as "current" and therefore the condition is not satisfied. The problem seems to be caused by the base system business rule named Location - generate full name. As a workaround, change the order of the custom business rule to a value lower than 100 (for example, 90).
The business rule Location - generate full name also calls HierarchicalReference to generate the full_name on Locations. This performs an update (to generate the full_name for hierarchy location) so previous = current on contract change.
For more information, see Defining Locations in the product documentation.