Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

UI Action calls Record Producer to navigate and pass variable values to preset onLoad

Christine A
Tera Contributor

I have a ui action that calls a record producer and passes a value to one of the variables and launches the record producer. However I am getting an error message when the record producer's onLoad Client script is called:

ReferenceError: RP is not defined
at presetFields (com.glideapp.service…sset_manager:865:15)
at onLoad_57060aeb87b40610739742e8cebb35bb (com.glideapp.service…asset_manager:870:1)
at com.glideapp.service…asset_manager:877:1
at js_includes_doctype.jsx:557:4
at runBeforeRender (js_includes_doctype.jsx:474:5)
at z_last_include.jsx:33:2
at z_last_include.jsx:39:3

-------------------------------

UI Action:

    var reqBy = 'asset_manager';
    var url = 'com.glideapp.servicecatalog_cat_item_view.do?sysparm_id=1297d75ba1617010fa9b20d39126489f';
        url += '&sysparm_requested_by=' + reqBy;
    g_navigation.open(url, '_blank');
 
-----------------------
On the Record Producer (Asset Reclamation Request ... ham and sam)
... onLoad client script:
function presetFields() {
 var reqBy = RP.getParameterValue('requested_by');
 RP.setValue('requested_by', reqBy);
};
presetFields();
 
-------- 
note the variable: ChristineA_0-1710352642502.png

 

The url it generates is: /com.glideapp.servicecatalog_cat_item_view.do?sysparm_id=1297d75ba1617010fa9b20d39126489f&sysparm_requested_by=asset_manager

 

Any help much appreciated.

0 REPLIES 0