Business rule does not seem to fire on "insert"

Nisar2
Mega Guru

I've a BR set up on the incident table with the following conditions:

 

When to run: after

Order: 200

Insert: true

Update: true

Filter condition: (the highlighted part is what I'm expecting to become true)

Nisar2_0-1712898417840.png

 

But when incident is created and "Is Child" becomes true, the BR is still not firing.

Nisar2_4-1712898561685.png

 

I know the BR is not firing because:

(a) I put a gs.log statement on the 1st line of the BR under "Advanced" and it's not showing up in the log table

(b) I enabled the session debugger and it did report that the BR did not fire because the condition did not match. Now my question is is there a way to know from the debugger why the condition did not match?

 

 

8 REPLIES 8

Amit Pandey
Kilo Sage

Hi @Nisar2 

 

Is this working on update?

 

Regards,

Amit

Yes, it works on update.

arnabwa
Giga Guru

Hi Nisar,

 

In my opinion, the 'changes to' condition is not working here. You can test it in this way: 

- remove the changes to condition and just put 'is' there just for testing and you will see your Brule triggers.

 

2nd thing you can check is: 

- Since your condition depends on the 'Is Child' field, you need to print and check whether this 'Is Child' field is actually turning to true or not before the Brule runs. From the name of the field, I can understand this is a custom field and you are setting this through some other script. So essentially what I mean is, rather than checking that the Brule is not triggering, you need to check if the 'Is Child' field is getting set to true before this Brule triggers. 

 

Overall, we can say that a Brule does not trigger only and only because of conditions not being met. 

 

Hope you find what you want,

Many Thanks,

Arnab

Hi @Nisar2 

 

If it works on Update, I agree with Mr. @arnabwa Changes to condition will not work on insert. You need to be 100% sure if the change happens before this business rule executes. 

 

Regards,

Amit