I want my Record producer to redirect to a homepage after submitting the record with a message of the RITM submitted?

Raju Singh1
Tera Expert

I want my Record producer to redirect to a homepage after submitting the record with a message of the RITM submitted?

I am trying with this code but still it is not redirecting me to the home page and redirects me to the RITM page.

function onSubmit() {

    //Type appropriate comment here, and begin script below

    function onLoad() {    

        setTimeout('clearMsg()', 4000);  

}  

function clearMsg(){  

  g_form.clearMessages();

  producer.redirect = producer.redirect = "https://katerradev.service-now.com/nav_to.do?uri=/home.do"  

//action.setReturnURL(current);

    //window.top.close();

}  

}

Capture_Code.JPG

Capture.JPG

Capture1.JPG

1 ACCEPTED SOLUTION

leebooth
Kilo Expert

In your record producer script


find_real_file.png



The below is what I've used for an incident which redirects to the service catalog screen. Adjust the message to your needs.




  1. var msg = "The incident " + current.number + " has been opened based on your report.<br/>";
  2.       msg += "Due to the potentially sensitive nature of the accident, viewing is restricted to the Facilities team.<br/>";
  3.       msg += "They will contact you if they require any further information.";
  4. producer.redirect = "catalog_home.do?sysparm_view=catalog_default";
  5. gs.addInfoMessage(msg);

View solution in original post

11 REPLIES 11

Hold on a sec. Are you actually talking about a Record Producer? Requests and Request Items are usually the product of submitting a Catalog Item or an Order Guide.


Kalaiarasan Pus
Giga Sage

There is 2 producer.redirect which is not required and add it to the producer script.



producer.redirect = "https://katerradev.service-now.com/nav_to.do?uri=/home.do"


leebooth
Kilo Expert

In your record producer script


find_real_file.png



The below is what I've used for an incident which redirects to the service catalog screen. Adjust the message to your needs.




  1. var msg = "The incident " + current.number + " has been opened based on your report.<br/>";
  2.       msg += "Due to the potentially sensitive nature of the accident, viewing is restricted to the Facilities team.<br/>";
  3.       msg += "They will contact you if they require any further information.";
  4. producer.redirect = "catalog_home.do?sysparm_view=catalog_default";
  5. gs.addInfoMessage(msg);

Yes, Lee!!



You are correct!! This works like a Charm!!



Thank you my friend!!



Regards,


Raju Singh


Hi Raju, glad this is working for you!



Can you mark as correct please.