Form Link UI Action opens Record Producer

matthew_strecke
Kilo Contributor

I'm on a project form and I added a form link UI action and I want it to open the record producer that is associated with one of the related lists on the form. So if I click the UI Action it should open the Record Producer with the Project field populated with the project I was just on. Below is my code: find_real_file.png

Right now when I click it nothing happens.

1 ACCEPTED SOLUTION

Hey Matthew,



Well as you want to set the record producer values too...you have to pass the variables over the url and write an onLoad script on the record Producer which will parse the values and set.



function redirectTORP(){


      var str = 'com.glideapp.servicecatalog_cat_item_view.do?v=1&sysparm_id=1ff40761d7612100b7490ee60e610347';


str += "&sysparm_discoveryProject=" + "YOUR VARIABLE";


action.setRedirectURL(str);


}



3 Ways to Populate Values in ServiceNow via the URL


https://www.servicenowguru.com/scripting/client-scripts-scripting/parse-url-parameters-client-script...


View solution in original post

3 REPLIES 3

Surendra Raika1
Kilo Guru

have you tried this :



window.location.assign(str);


I just tried that and no luck.



Thanks,


Matthew Strecker


Hey Matthew,



Well as you want to set the record producer values too...you have to pass the variables over the url and write an onLoad script on the record Producer which will parse the values and set.



function redirectTORP(){


      var str = 'com.glideapp.servicecatalog_cat_item_view.do?v=1&sysparm_id=1ff40761d7612100b7490ee60e610347';


str += "&sysparm_discoveryProject=" + "YOUR VARIABLE";


action.setRedirectURL(str);


}



3 Ways to Populate Values in ServiceNow via the URL


https://www.servicenowguru.com/scripting/client-scripts-scripting/parse-url-parameters-client-script...