Alternative solution for RP.getParameterValue()

Community Alums
Not applicable

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()?

5 REPLIES 5

Runjay Patel
Giga Sage

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 

Sai_Charan_K
Kilo Sage

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 

Community Alums
Not applicable

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);

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?