The CreatorCon Call for Content is officially open! Get started here.

Redirecting to URL in UI Action Script not Working

Balaraju K B
Tera Expert

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 :

BalarajuKB_0-1680177383631.png

Thank you in Advance

Bala

10 REPLIES 10

Hi @Ankur Bawiskar Tried updating the script but still notredirecting Please find the script below :

BalarajuKB_0-1680249677164.png

 

@Balaraju K B 

can you check in log what came in json response?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar Please refer the screenshot below:

BalarajuKB_0-1680255132254.png

 

@Balaraju K B 

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

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar Still not redirecting let me debug