Run BPM Workflow On Delete Signal

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dodom2
    Senior Member
    • Jan 2020
    • 198

    Run BPM Workflow On Delete Signal

    I have a BPM script setup which calculates my customers account balance based on account charges and account payments. My issue is when I delete a "Charge" then it runs this BPM based on the delete signal. I need to recalculate the customers account balance at this point as a charge was deleted from the system. I need to get the Customer ID of the deleted record however being the record gets deleted I can't access this data. I tried with

    $customer=bpm\targetEntity\attribute(clientId);

    No Luck. Does anyone have a idea on how to get the related customer account id when the record is deleted?
  • emillod
    Active Community Member
    • Apr 2017
    • 1405

    #2
    dodom2
    i tried to reproduce your problem on demo, but i had weird results..
    From hand i have two ideas:
    1. Try to use formula to get an id
    2. You can simply create a hook afterRemove which will do the job.

    Comment


    • dodom2
      dodom2 commented
      Editing a comment
      Hi Emillod. Thank you. I could use the workflow\trigger function if I could get the related invoice id from the deleted payment record. My issue is once a record is deleted then it no longer gives access to the payment record. Any other ideas?
Working...