Update boolean field if any related entity dropdown value is ABC

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

    #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
    • 1147

    #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

    • Marcel
      Junior Member
      • Jul 2025
      • 26

      #3
      @lazovic

      Thank you very much for your answer! But that is only working, if the usageType field is on the Contract object itself or? The usageType is on a related "ContractObject" Object.

      Entity: CCustomer
      Field: changeOfAddress​
      Related to: 1:n CContract

      Entity: CContract
      Related to: n:1 CCustomer
      Related to: 1:n CContractObject​

      Entity: CContractObject
      Field: usageType​​
      Related to: n:1 CContract


      So my CContract is the man in the middle and if I open a CContract and add a new related CContractObject with the usageType == 'Owner occupancy' than the Entity CCustomer Field changeOfAddress should be set to true.

      Is that possible?
      Thank you!

      Comment

      Working...