How to redirect to the same form after click on submit button ?

SURYA CHANDRA B
Kilo Contributor

when i click on submit button my record should be inserted in to table and i should redirect to the same form for another record insertion 

1 ACCEPTED SOLUTION

Mark Roethof
Tera Patron
Tera Patron

Hi there,

You could change the Submit UI Action or create a custom when and add code like:

action.setRedirectURL(current);

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark

---

LinkedIn

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

View solution in original post

4 REPLIES 4

Mark Roethof
Tera Patron
Tera Patron

Hi there,

You could change the Submit UI Action or create a custom when and add code like:

action.setRedirectURL(current);

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark

---

LinkedIn

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

After redirect to the same form, i should not have contents in my form how ?

@Mark Roethof 

Where can you write this code on the Submit UI Action widget?

 

Thanks

Elijah Aromola
Mega Sage

If you're wanting to be redirected back to a new form you can do the following: 

current.insert()
var instanceURL = gs.getProperty('glide.servlet.uri');
var table = 'table_name'
action.setRedirectURL(instanceURL + '/' + table + '.do?');

 

Please mark this as helpful/correct if it resolved your issue!