A custom UI Action is not working as expected. When the UI Action is script is executed there is following error seen in the browser console:
Uncaught TypeError: Cannot read property 'apply' of undefined
CauseThis occurs when you have the following statement in your code:
var gr = GlideRecord("<tablename>");
eg. var gr = GlideRecord("sys_user");
It is necessary to utilize the "new" operator to create an instance of the GlideRecord before it can be used successfully from custom scripts.
Modify the statement to utilize the new operator:
var gr = new GlideRecord("<tablename>");
eg. var gr = new GlideRecord("sys_user");
For more information please see the following links.