How to execute a formula when a record is deleted?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • FSuarezJimenez
    Junior Member
    • Aug 2022
    • 1

    How to execute a formula when a record is deleted?

    I have two entities related one-to-one. I want that, when I delete a record from entity 1, the related record from entity 2 is also related.

    I could do this:

    Code:
     record\update(ENTITY2, ID, 'deleted', true);
    but my problem is that the formula is not executed when I delete a record (with the GUI), any idea on how to do it?
  • shalmaxb
    Senior Member
    • Mar 2015
    • 1606

    #2
    Your code should work, but here is the part missing, as when this should happen. I guess, you will need a ifThen formula with your formula in the "Then" part:

    ifThen(
    record\update(ENTITY1, ID, 'deleted', true);
    record\update(ENTITY2, ID, 'deleted', true)
    );

    Comment

    Working...