How to call custom UI Action that overrides global in gsftSubmit

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2019 05:36 AM
Hello,
I have an 'Update' UI action on specific table that overrides the global UI action. I made my custom button to do some client side validation so if nothing changed on the form not to update the record else to do some server-side code. Here is the code
however the gsftSubmit always call the global UI action. It seems to be always on the form at the backend. I tried to add condition to global button to exclude tablename (current.sys_class_name != ' myTable' ) but it does not work it is still taken in the submit.
function checkModified() {
if(!g_form.modified){
alert('You have not made any changes to the form!');
return false;
}
gsftSubmit(null, g_form.getFormElement(), 'sysverb_update');
}
if (typeof window == 'undefined') {
// My server-side code
}
Is there a way to explicitly call the button by its gsft_id, but not the id which is the same as the global one ?
Any help please ?
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2019 05:45 AM
PS. I know this can be handled with onSubmit client script but still would like to know if can be done within UI Action as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2019 05:50 AM
Have you tried changing the action name on your UI action and calling that in the gsftSubmit instead? eg:
gsftSubmit(null, g_form.getFormElement(), 'something_else');

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2019 12:29 AM
If I change the name of my custom UI action that is supposed to override Global one I will end up with two button on the form (which is normal by design). I did that so I can see both buttons on the form so in order to inspect my custom button and test if the code does what it is expected (and it did), but as soon as you revert the action_name in gsftSubmit back to original name it seems that it always pick up the global UI action. I also try to play with the 'Order' of both UI action but with no success.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2019 05:52 AM
Do you mean that your 'Update" UI button is not getting called, but the global "Update" UI button is?
Check and see if you have the following configured:
- "Client" field is checked. This will call the client script in your code.
- "Onclick" field is configured to call checkModified().