Comments on: Identifying UI Action Clicked (The Right Way) https://servicenowguru.com/client-scripts-scripting/identifying-ui-action-clicked-submit/ ServiceNow Consulting Scripting Administration Development Thu, 07 Mar 2024 19:34:17 +0000 hourly 1 https://wordpress.org/?v=6.8.2 By: Mark Stanger https://servicenowguru.com/client-scripts-scripting/identifying-ui-action-clicked-submit/#comment-7666 Thu, 03 Sep 2015 12:58:01 +0000 https://servicenowguru.wpengine.com/?p=964#comment-7666 In reply to Jochen.

Thanks, I’ve removed it from the post above. Please let me know if you find another way to get that to work.

]]>
By: Jochen https://servicenowguru.com/client-scripts-scripting/identifying-ui-action-clicked-submit/#comment-7665 Thu, 03 Sep 2015 11:59:17 +0000 https://servicenowguru.wpengine.com/?p=964#comment-7665 action.getActionName() is no longer supported in Business Rules:
“java.lang.SecurityException: Illegal access to method getActionName() in class com.glide.script.ActionDescriptor”

]]>
By: Mark Stanger https://servicenowguru.com/client-scripts-scripting/identifying-ui-action-clicked-submit/#comment-7664 Wed, 24 Sep 2014 11:08:29 +0000 https://servicenowguru.wpengine.com/?p=964#comment-7664 In reply to Hema.

If it works fine for all other catalog items, then you’ve probably got another client script or form element that’s interfering. I would check your browser console log for errors and see where that leads you.

]]>
By: Hema https://servicenowguru.com/client-scripts-scripting/identifying-ui-action-clicked-submit/#comment-7663 Wed, 24 Sep 2014 09:41:08 +0000 https://servicenowguru.wpengine.com/?p=964#comment-7663 Hi Mark,

Yes, as you said I am using it in a OnSubmit client script only. And this particular function works perfectly for all other catalog items except for the one I am using. So it might not be a instance issue though. Please let me know if there is any other workaround for this.

Thanks,
Hema

]]>
By: Mark Stanger https://servicenowguru.com/client-scripts-scripting/identifying-ui-action-clicked-submit/#comment-7662 Tue, 23 Sep 2014 11:57:20 +0000 https://servicenowguru.wpengine.com/?p=964#comment-7662 In reply to Hema.

I just tried the exact same thing on a SN demo instance and it worked fine. The only thing I can think of is that you’re not using it in an ‘onSubmit’ client script…which is pretty much the only place it would be applicable. If you’re using it in an ‘onSubmit’ client script, then you should try setting up a similar scenario in a clean demo instance to validate if the issue is your instance or not.

]]>
By: Hema https://servicenowguru.com/client-scripts-scripting/identifying-ui-action-clicked-submit/#comment-7661 Tue, 23 Sep 2014 06:20:52 +0000 https://servicenowguru.wpengine.com/?p=964#comment-7661 Hi Mark,

I used the below line in my code.

var action = g_form.getActionName();
alert(action);

and what i got is undefined in the alert.
Due to this my code which is using the action is not getting proceeded. Is there any reason for the above script to retuen undefined value? Please advise.

Thanks,
Hema

]]>