RP is not defined

Andrii
Kilo Guru

Hi,

I am getting this error:

org.mozilla.javascript.EcmaError: "RP" is not defined.

Caused by error in Business Rule: 'My_Incident_Business_Rule' at line 9

6: inc.addQuery('state','!=',1);

7: inc.addQuery('parent',current.parent);

8: inc.addNotNullQuery('parent');

==> 9: inc.query();

10:

11: // initial value

12: var wtd = 0.0;

and I wonder why RP is not defined? Any ideas?

Seems that I have 2 Business Rules on Incident [ incident ] Table that have some conflict:

1) Before Query Business Rule that leverages RP: "

RP.getParameterValue('sysparm_query');

"

2) After Business Rule

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

When ever the first script does a query, it uses the before/query business rules to do any filtering. It's the same if you present a list to a user. So the inc.query() is triggering the before business rule which cannot find RP. This is not a standard OOB BR. Do you know who wrote it and what it's purpose is? If not, I recommend disabling it as a test to ensure the other BR works fine.


View solution in original post

7 REPLIES 7

Or may be try {} catch {} would work better


That should work. Some alternatives...



if (RP) {


        RP.getParameterValue('sysparm_query');


}



Or you could use a try/catch


If I have answered your question, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.



If you are viewing this from the community inbox you will not see the correct answer button.   If so, please review How to Mark Answers Correct From Inbox View.



Thank you