g_form.save, g_form.submit and gsft method I am saving form but the form is loading again and again
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2022 12:12 AM
Hello Everyone,
I want to thank you all in advance.
I am facing issue while using g_form.save(), g_form.submit(); and gsftSubmit(null, g_form.getFormElement(), 'sysverb_update_and_stay'); method
The requirement is to save the record coming from the script include everything is working fine but when I am trying to save my record in the onchange client script with the above method the form is getting loaded again and again for me.
Here is the code I wrote -
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var ga_project = new GlideAjax('sn_hr_core.ProjectDetailsPosition');
ga_project.addParam("sysparm_name", "get_ProjectName");
ga_project.addParam('sysparm_usr', g_form.getValue('u_project_number'));
ga_project.getXML(getCal);
function getCal(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
g_form.setValue('u_project_name', answer);
g_form.save();
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2022 01:32 AM
Hello @Swapnil Shirsik
It works with that, but my requirement is to save the record without clicking on any button that why I used g_form.save();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2022 01:34 AM
Did you try with return true; instead of g_form.save();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2022 03:33 AM
Yes I tried it's not working