- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2021 01:22 PM
Dear Experts,
This one has me stumped. Just trying to overwrite a submit form button in order to do a record count check. The call to the script include works fine and issues the alert if required. But, the server code never runs. Any help would be appreciated!
Thanks - Ian B.
function Submit() {
var ga = new GlideAjax('Count_Tasks');
ga.addParam('sysparm_name', 'getRecordCount');
ga.addParam('sysparm_table', g_form.getValue("test"));
ga.getXMLAnswer(_handleResponse);
function _handleResponse(response) {
if (response >= 0) {
alert("There are too many tasks to process given the current data parameters");
return;
}
else {
gsftSubmit(null, g_form.getFormElement(), 'Submit Test');
}
}
}
if(typeof window == 'undefined')
u_runServerCode();
//Server-side function
function u_runServerCode(){
gs.addInfoMessage('before save');
answer = current.insert();
gs.include('ActionUtils');
var au = new ActionUtils();
au.postInsert(current);
action.setRedirectURL(current);
}
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2021 02:01 PM
Hi,
Replace the third parameter of gsftSubmit from UI Action Name to Action Name.
gsftSubmit(null, g_form.getFormElement(), 'sysverb_insert');
Regards,
Muhammad
Muhammad

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2021 02:01 PM
Hi,
Replace the third parameter of gsftSubmit from UI Action Name to Action Name.
gsftSubmit(null, g_form.getFormElement(), 'sysverb_insert');
Regards,
Muhammad
Muhammad