Logs are not shown on a AFTER business rules for DELETE

Facundo Prado
Tera Expert

Hello everyone!

I have a business rule to Insert, Update, and Delete.

 

I add a gs.info to see which operation is displayed.

FacundoPrado_0-1726761699542.png

 

But here´s the thing:

If we run this br on AFTER:

The insert and update options are recognized, but NOT the Delete.

FacundoPrado_1-1726761699543.png

 

 

BUT, If we run this br on BEFORE, the logs appears:

FacundoPrado_2-1726761902862.png

 

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.)

1 REPLY 1

Community Alums
Not applicable

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