Is there a way to have a record producer return to a blank record producer after its submitted?

chris_choi
Giga Contributor

Hello Community,

Our Service Desk features a walk up Service Desk, and what they wanted to have set up is a very simple form with caller and short description to submit incidents to the walk up desk and have a list of incidents opened sorted by created, to have a queue of which person is next to be helped (basically first come first serve).

My question was using a URL and an icon on an ipad (this is how they will submit their incident), have that open up a record producer page with the 2 fields mentioned above. When they click submit, normally they would be taken to an "Incident is submitted" and here's the self service view. We want our users to be able to submit it and the form reset itself for the next user (kiosk style). Is there a way to submit the incident from the record producer, then have it go back to the same form blank ready for another submission?

Bonus points if we can display a temporary message to acknowledge incident is submitted that goes away automatically.

Any suggestions that may help are greatly appreciated. Thanks.

1 ACCEPTED SOLUTION

Miriam Berg
Kilo Guru

Hi Chris,



In order to specify the page redirected to after submit, add this as the final row of the record producer's script field:



producer.redirect = "your_url";



Replace "your_url" with the url to your item. You can for example get the URL from opening the preview link on the record producer and then copying the URL from the address field.




In order to display the temporary info message, you could create an onLoad script with the following code:



function onLoad() {


        setTimeout('clearMsg()', 4000);


}


function clearMsg(){


  g_form.clearMessages();


}



Of course combined with the redirect you created. In the example I chose a delay time of 4000ms = 4 seconds.



Good luck!


BR /Miriam


View solution in original post

5 REPLIES 5

Deepak Ingale1
Mega Sage

action.setReturnURL(current);



You can try with above link at the end of your record producer script if that works.


Add below script (last line) in "Script" field of Record Producer



producer.redirect = '/com.glideapp.servicecatalog_cat_item_view.do?sysparm_id=<sys_id>



<sys_id> replace this with sys_id of Record Producer, that you can get either from URL of Record Producer (if opened in new tab) or using right click on header -> Copy sys_id.



Thanks,
Kamlesh


Miriam Berg
Kilo Guru

Hi Chris,



In order to specify the page redirected to after submit, add this as the final row of the record producer's script field:



producer.redirect = "your_url";



Replace "your_url" with the url to your item. You can for example get the URL from opening the preview link on the record producer and then copying the URL from the address field.




In order to display the temporary info message, you could create an onLoad script with the following code:



function onLoad() {


        setTimeout('clearMsg()', 4000);


}


function clearMsg(){


  g_form.clearMessages();


}



Of course combined with the redirect you created. In the example I chose a delay time of 4000ms = 4 seconds.



Good luck!


BR /Miriam


Kamlesh Prasad
Kilo Expert

I missed your message part. Here below you can try in script section that should work:



gs.addInfoMessage('Your ticket '+current.number+' has been logged'); //modify this as you want


producer.redirect = '/com.glideapp.servicecatalog_cat_item_view.do?sysparm_id=<sys_id>


assumption - https://myinstance.service-now.com/com.glideapp.servicecatalog_cat_item_view.do?sysparm_id=<sys_id> is your request URL



<sys_id> replace this with sys_id of Record Producer, that you can get either from URL of Record Producer (if opened in new tab) or using right click on header -> Copy sys_id.



Thanks,
Kamlesh