- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2016 05:31 AM
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
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2016 05:52 AM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2016 05:52 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2016 06:13 AM
I do understand that inc.query() triggers Before Query Business Rules - the question is - RP is not defined because rule triggered not from UI ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2016 06:14 AM
That's correct.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2016 06:22 AM
So If I add condition into another Business Rule, something like:
if (RP != 'undefined') { ... }
that should work I guess