Update boolean field if any related entity dropdown value is ABC

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Marcel
    Junior Member
    • Jul 2025
    • 24

    #1

    Update boolean field if any related entity dropdown value is ABC

    Hi all,

    I have an Entity called Contracts and that has a One to Many relationship to ContractObjects and a many to one relation to customer.

    When I now open a contract and create a new relation to a Contract Object where I set the dropdown menu value of a field called usageType to "Owner occupancy" (Or modify the relation) the Boolean field called changOfAddress on the customer Object should be set to true.

    Is that somehow possible?

    Thanks!
  • lazovic
    Super Moderator
    • Jan 2022
    • 1146

    #2
    Hi @Marcel,

    Please try to use the following formula script in the Contract Object entity:
    Code:
    if (entity\isAttributeChanged('contractId') && usageType == 'Owner occupancy') {
        $customerId = record\attribute('Contract', contractId, 'customerId');
        record\update('Customer', $customerId, 'changOfAddress', true);
    }

    Comment

    Working...