Alternative solution for RP.getParameterValue()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-06-2024 01:15 PM
com.glide.script.RhinoEcmaError: "RP" is not defined.
sys_script.e6ffde8fdbb54150c14aa90b8a9619e0.script : Line(12) column(0)
9: current.addActiveQuery(); //Keep it OOB
10: }
11: } else {
==> 12: if (RP.getParameterValue("sys_id") != "4f79f4ed1bf995108e576288bd4bcb68" || RP.getParameterValue("id") != "hrm_todos_page") {
13: current.addActiveQuery(); //OOB
14: }
15: }
Logs is throwing a warning so is there an alternative solution for RP.getParameterValue()?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-06-2024 07:03 PM
Hi @Community Alums ,
where are you trying to use this ? It does not work every place. Get me more details will help with alternative solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-06-2024 07:10 PM
Hi @Community Alums ,
The warning states that RP which you used in line no. 12 is not defined. Can you please verify the script or maybe share the whole script so that we can help you ?
Thanks and Regards,
K. Sai Charan
Senior ServiceNow Developer
Deloitte India
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-24-2024 07:36 AM
Script:
(function executeRule(current, previous /*null when async*/ ) {
if (gs.getUser().getID() == "cf34d4d41b12b410e2fedd79b04bcb0e") { //BTOps_UA_R user's ID
var isVariablePresent = gs.action.getGlideURI().toString().indexOf("1d15e5d71ba2f050e2fedd79b04bcbe0"); //Requestor variable sys_id on "CSL Offboarding" catalog item
var isOffboardingCatalog = GlideTransaction.get().getRequest().getHeader("referer").toString().indexOf("4197ed721b1af410e2fedd79b04bcb7b"); //sys_id of the catalog item "CSL Offboaring"
if (isVariablePresent != -1 || isOffboardingCatalog != -1) {
//Do nothing
} else {
current.addActiveQuery(); //Keep it OOB
}
} else {
if (RP.getParameterValue("sys_id") != "4f79f4ed1bf995108e576288bd4bcb68" || RP.getParameterValue("id") != "hrm_todos_page") {
current.addActiveQuery(); //OOB
}
}
})(current, previous);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-24-2024 07:44 AM
Hi,
Did you copy this script logic from another place (like a record producer) into this business rule?
Nowhere in this business rule is the variable "RP" defined, that's why you are experiencing the error.
What are you trying to do?