Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Redirect Submitter to created record

Wyatt Fudal1
Tera Guru

Hello, 

I running into an issue with a record producer. Would I be able to add a redirect once the record producer form is submitted? Have the submitter redirected to the record that was created. I did not create this record producer. I have it selected and scripted but it does not work.

WyattFudal1_0-1711740044698.pngWyattFudal1_1-1711740075307.png

WyattFudal1_2-1711740089976.png

 

 

1 ACCEPTED SOLUTION

Hello try this one:

 

var instance = gs.getProperty('instance_name');
producer.redirect = "https://" + instance + ".servicenow.com/nav_to.do?uri=u_contract_master.do?sys_id=" + current.sys_id;

 

 Please Mark my Answer Helpful & Accept as Solution, If this solves your issue. 

View solution in original post

6 REPLIES 6

Dr Atul G- LNG
Tera Patron
Tera Patron

Will this not work

 

AGLearnNGrow_0-1711740816627.png

 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Hello AG,

I have redirect to go to the task record being generated. for some reason, it's not working. I did notice some code in the record producer. Thank you for your response.

//var wflw = new Workflow();
//wflw.startFlow(wflw.getWorkflowFromName('Contract Administration V2'), current, 'update');

//producer.portal_redirect = "cca";
//gs.addInfoMessage("Your request for a new Contract has been received - it will be reviewed by Legal, you will be notified by email");


//Create the html contents of the information message

//var link = '<a href="cca?id=form&table=u_contract_master&sys_id=' + current.sys_id + '" >' + current.u_number + '</a>';
//var link = '<a href="change_request.do?sys_id='                 + current.sys_id + '" class="breadcrumb" >' + current.number   + '</a>';

//gs.addInfoMessage('link: ' + current.sys_id);
//gs.addInfoMessage('u_number: ' + current.u_number.getDisplayValue());
//gs.addInfoMessage('sysId: ' + current.sys_id);

//var message = ''; //Contract Master ' + link + ' has been created.<br/>';
//message += 'Thank you for your submission.';

//Add the information message
//gs.addInfoMessage(message);

//Redirect the user to the homepage
producer.portal_redirect = "/cca?id=form&table=u_contract_master&sys_id="+current.sys_id;
producer.portal_redirect = "/cca?id=cca_thankyou";
producer.portal_redirect = gs.getProperty('instance_name')+'/u_contract_master.do?sys_id='+current.sys_id;

Hello @Wyatt Fudal1 ,

 

Can you try with this once.

 
var instance = gs.getProperty('instance_name');
var url1 = "https://" + instance + ".service-now.com/sp?id=sp_ticket&is_new_order=true&table=<your table name>&sys_id=" + current.sys_id;
producer.redirect = url1;

 

Please Mark my Answer Helpful & Accept as Solution, If this solves your issue. 

Hello Appanna,

After I submit the record producer it brings me to the task created but I'm still in the portal. Would there be a way to bring the submitter to the record in the table?