- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2018 08:03 AM
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:
Right now when I click it nothing happens.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2018 01:19 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2018 12:33 PM
have you tried this :
window.location.assign(str);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2018 12:45 PM
I just tried that and no luck.
Thanks,
Matthew Strecker
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2018 01:19 PM
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