Announcement

Collapse
No announcement yet.

Trigger events when removing contacts (change linked custom entities)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Trigger events when removing contacts (change linked custom entities)

    First things first, Espo CRM is a wonderful CRM. Thanks to the custom modules it can configure to be much more than that... Wonderful.

    I ran into an issue though that I hope someone can help me with.

    I created a custom entity: Membership. Every contact can have one or more memberships. I would like to be able to update memberships to "deleted" whenever a contact is removed. How would I do that?

  • #2
    Paid option would be Workflow...

    Free option... not sure if it possible. You can change a field call "status" to "delete"; Status: Delete
    using formula, but the record will still be there, it can't be automated delete. I suppose you can add in a visibility condition where most user can't see it except for certain group/admin... but the record will still be there!

    Comment


    • #3



      Contact -> afterRemove


      foreach($memberships as $membership )
      $membership->set(['deleted' => 1]) or removeFromDb. https://docs.espocrm.com/development...delete-from-db






      Comment


      • #4
        Many thanks! I will try these options and report back over here.

        Comment

        Working...
        X