Redirecting to URL in UI Action Script not Working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2023 04:58 AM
Hi Everyone,
I have created an UI Action on Custom Scoped Table and Written script to auto create an RITM by submitting the catalog item via script.
Issue 1 : I'm able to create the RITM using script but not able to Redirect to the Created RITM.(Please refer the script in the screenshot)
Issue 2 : Want to set the variable values dynamically using the current.<field_name> from the custom table which I have written the UI Action but its not working.
Please refer the below script :
Thank you in Advance
Bala
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2023 01:01 AM
Hi @Ankur Bawiskar Tried updating the script but still notredirecting Please find the script below :
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2023 01:39 AM
can you check in log what came in json response?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2023 02:32 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2023 02:41 AM
then do this
var gr = new GlideRecord("sc_req_item");
gr.addQuery("request.number", reqNumber);
gr.query();
if (gr.next()) {
var url = 'sc_req_item.do?sys_id=' + gr.getUniqueValue();
action.setRedirectURL(url);
}
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2023 04:45 AM
@Ankur Bawiskar Still not redirecting let me debug