So I've added a credit memo module. The goal is for me to give my clients credit for various reasons. When I create a credit it will automatically recalculate the related invoice totals. That part works great. But if I decide to remove a credit I prefer to delete the credit completely from the system. When I delete the credit then it needs to recalculate the related invoice totals. My issue is once the credit is deleted then you cant access the credit record attributes such as the related invoice id any longer. Does anyone know a way around this to where I can delete the credit but still recalculate the related invoice totals?
Announcement
Collapse
No announcement yet.
Recalculate Totals After Deleted Record Triggers Delete Signal in BPM
Collapse
X
-
i think you need to use a Script Task to grab the deleted credit id (using deleted, 1) and then you can find the related invoice id to do your calculation.Rabii
Web Dev
-
Thank you Rabii. I dont understand exactly. So I can get the ID of the deleted record but once that record is deleted you can't access the attributes to know my knowledge. So how can I access the invoice id that you mention?Last edited by dodom2; 12-30-2022, 05:55 PM.
-
-
i think you can try using a Script Task and use code below:
Code:$creditId = record\findOne('Credit', 'createdAt', 'desc', 'id=', id, 'deleted', true);
ThanksRabii
Web Dev
Comment
Comment