how can we write the on submit client script for saving the form and redirect to the same page when we click on Submit button,the functionality of Submit button is by clicking on that it will redirect to list of records.How can we achive this by on s

naresha
Kilo Contributor

OnSubmit Client script for when we click on Submit button it needs to stay in the same page after saving the form:

how can we write the on submit client script for saving the form and redirect to the same page when we click on Submit button,the functionality of Submit button is by clicking on that it will redirect to list of records.How can we achive this by on submit client script.

9 REPLIES 9

Abhinay Erra
Giga Sage

use this in client script


window.open("<your table_name>.do?sys_id="+g_form.getUniqueValue()","_self");


corrected


window.open("<your table_name>.do?sys_id="+g_form.getUniqueValue(),"_self");


I tried with this,did n't get expected result .because how sysid will generate once we click on submit.i put some alert to find which sys id is coming.it is returning previous record sys id.


Abhinay Erra
Giga Sage

What do you mean by previous record sys_id.?   sys_id of a record is generated on load. So when you say g_form.getUniqueValue() it will give you the sys_id of that record you are about to submit


mrswann
Kilo Guru

you want the submit button to exactly as save button??



I read someone on here state quite nicely that if you change the behaviour of something as widely used as Submit you cause confusion to users




I suggest pushing people to use the save button and education