Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Business rule to run on view

pdom
Mega Expert

I have to execute a particular business rule only when the update on Incident form happens from a particular view. I have created a new view called "xMatters" on Incident form.

As business rules are not view specific, I have created a field called u_view on Incident form. Created an onLoad client script to set the current view in that field.

Therefore my business rule is an after update, so I am verifying the u_view field in condition, all good.

Now I have to clear this field because the subsequent incident updates should not trigger this business rule.

I have created another after update business rule with order 200, and doing current.u_view = 'NULL'; current.update();

  1. This does not seem to be working. The field is not clearing off Could you point me what might be   going wrong here.
1 REPLY 1

Uncle Rob
Kilo Patron

Why not integrate it into the original rule?



just add...


current.u_view = '';



before the current.update.



When you set the field to current.u_view = 'NULL' you're not instructing it to be empty.   You're instructing it to write the letters N, U, L, L in the string.