what is the Use of gsftSubmit , why should we use it, when use it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2018 07:23 AM
Hi,
Please don't copy and past WIKI information, please explain in your own words..
why should we use, ?? when ??? why??? what is the purpose
i have taken this script from wiki.. what is explains here , : UI action: Reopen Incident
already we have UI action name ,so whay should we use gsftSubmit ????
function reopen(){
if(g_form.getValue('comments') == ''){
//Remove any existing field message, set comments mandatory, and show a new field message
g_form.hideFieldMsg('comments');
g_form.setMandatory('comments', true);
g_form.showFieldMsg('comments','Comments are mandatory when reopening an Incident.','error');
return false; //Abort submission
}
//Call the UI Action and skip the 'onclick' function
gsftSubmit(null, g_form.getFormElement(), 'reopen_incident'); //MUST call the 'Action name' set in this UI Action
}
//Code that runs without 'onclick'
//Ensure call to server-side function with no browser errors
if(typeof window == 'undefined')
serverReopen();
function serverReopen(){
//Set the 'State' to 'Active', update and reload the record
current.state = 2;
current.update();
gs.addInfoMessage('Incident ' + current.number + ' reopened.');
action.setRedirectURL(current);
}
- 51,908 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2020 03:22 AM
Hi Jaspal,
I'm also searching for the same info. I've a question - I've defined client script and Processing Script in UI Page. Many functions as defined in the Processing Script field. If I use gsftsubmit(this) function in HTML page how to identify which function should execute first from Processing Script.
Regards,
Suresh.
Suresh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2020 03:32 AM
Hi,
gsftSubmit(null, g_form.getFormElement(), "ui action id") triggers the UI Action which is specified in the 3rd parameter, which is the action name/element id. It is mostly used in UI actions that have a client side and a server side script.
Please have a look into this also
Please mark it correct and helpful, if applicable
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2021 10:12 AM
Hi,
Please check below link:
https://servicenowguru.com/system-ui/ui-actions-system-ui/client-server-code-ui-action/
Thank you!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2022 09:50 AM
Hi,
I have used gsftsubmit and third parameter is action name which is same as that of function written for server side code run in same UI Action, but code written in function isn't working why this is so.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2022 06:42 AM
dfdf