Update boolean field if any related entity dropdown value is ABC

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • Marcel
    replied
    Originally posted by lazovic
    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);
    }

    Ah now I understand it!

    It is working. Thank you!

    Leave a comment:


  • Marcel
    replied
    @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!

    Leave a comment:


  • lazovic
    replied
    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);
    }

    Leave a comment:


  • 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!
Working...