Logs are not shown on a AFTER business rules for DELETE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2024 09:08 AM - edited 09-19-2024 09:12 AM
Hello everyone!
I have a business rule to Insert, Update, and Delete.
I add a gs.info to see which operation is displayed.
But here´s the thing:
If we run this br on AFTER:
The insert and update options are recognized, but NOT the Delete.
BUT, If we run this br on BEFORE, the logs appears:
Any idea?
Thanks!!
(PD: I´m trying tu run AFTER, because best practice is to use AFTER business rules when you're taking changes to one table to make updates to another table.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2024 11:11 AM
Hey @Facundo Prado
This should work, the problem is that in an afterDelete, "previous" is null. So it isn't that your statement for current.operation isn't working, it is that your other statements for "previous.getValue('...')" are creating an error in your script. Take your filter off the log table and you should find an error at that time saying: "Cannot convert null to an object...".
Comment out the lines that use "previous" and then this should work 🙂
Hope this helps!
~Nick