Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Get undocumented Service-now class information

User150433
Kilo Sage

Hi everyone,

I'm not sure how you deal with undocumented service-now classes. I wrote a simple global business rule which will list all the available constructors and methods of service-now classes.

Create this Global business rule with the attached script.

Normally these classes start with "Packages.com". Few interanl service now classes are

Packages.com.glide.schedules.Schedule
Packages.com.glide.glideobject.GlideDateTime

Go to
System Definition --> Scripts - Background

getClassInfo("com.glide.glideobject.GlideDateTime")

Click on "Run script" button.


it will List all constructors and Methods for you.

16 REPLIES 16

Not applicable

Great work! Now all we need is a list of classes.

thanks heaps.


wattsj
Kilo Expert

Amazing, thank you!


Marc54
Giga Guru

Somehow this stopped working (since fall 2010). Errormsg below.

*** Script: Class Information for : com.glide.glideobject.GlideDateTime
Security restricted: access to restricted class name java.lang.Class
Security restricted: access to restricted class name java.lang.Class
Evaluator: org.mozilla.javascript.EcmaError: [JavaPackage java.lang.Class.forName] is not a function.
Caused by error in Business Rule: 'getClassInfo' at line 3

1: function getClassInfo(className){
2: gs.print("Class Information for : "+ className);
==> 3: var classObj = java.lang.Class.forName(className);
4: var methods = classObj.getMethods();
5: // Getting Constructor information
6: var ctorlist = classObj.getDeclaredConstructors();


gaidem
ServiceNow Employee

😞 Doesn't work anymore