calling getActionName to get a button action, it return 'undefined'.. not sure what is not right

Angie Lee
ServiceNow Employee
ServiceNow Employee

Hi,

Been spending so much time troubleshooting the approval button. Not sure what is not right.. there's a client script that make Comment field mandatory when reject an approval. That seems to not working for some reason.. I log a alert to check what it actually return for g_form.getActionName. The value is 'undefined', that explain why it doesn't set the 'comment' field mandatory. What I am not sure is why it return 'undefined' instead of the button action. I check the reject button action name is 'reject'. Does anyone experience this before? For rejecting a change request, this button works correctly but for rejecting a record from custom table I created this button doesn't work. Anyone has any idea?

9 REPLIES 9

Michael Kaufman
Giga Guru

Instead of a client script, try a Data Policy or UI Policy.


geoffcox
Giga Guru

g_form.getActionName() instead of g_form.getActionName?


Mateen
Giga Guru

Hi There,



I am facing the same issue now, spent almost a week on this.



Did you happen to find a solution for it?



Mateen


Mateen
Giga Guru

I have resolved this issue. If somebody is facing this issue drop me a mail, I will try to help you.