Unable to find gs.action documentation

jraki
Tera Contributor

I would like to know which object is returned by the call "gs.action" or "gs.action.getGlideURI()" to understand what I can do with such objects, but I cannot find any documentation about these calls. I just discovered some calls examples in the community. Can anyone please let me know where I can find a documentation about "gs.action".

3 REPLIES 3

Goran WitchDoc
ServiceNow Employee
ServiceNow Employee

Sadly there isn't any official documentation about it. Otherwise it would show up on developer.servicenow.com



This is about what I know: What is "gs.action"?



//Göran


Thanks a lot Goran for your answer. I could never imagine that "gs.action" could have all these available calls without having them in the official API documentation.


It looks like they may have documented it over the past four years.

https://developer.servicenow.com/dev.do#!/reference/api/orlando/server/no-namespace/ActionAPIBoth

As near as I can tell, gs.action is the same as the globally (or top of scope) var "action" that is set under some conditions when the user triggers an action, usually via a button. Most likely, if you have a gs.action, there is probably also an action. And if you are expecting gs.action in a business rule, you are likely throwing a null pointer error when it doesn't.

gs.action.getGlideURI() would be the same thing as action.getGlideURI() in those cases, and when an action is not underway, you would throw a null point back into the invoking rhino / java.

Typically what people seem to want is either new GlideURI() which returns the same thing as gs.action.getGlideURI() or just action within the context of a scripted ui action.