Get undocumented Service-now class information
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-08-2009 06:27 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-05-2013 01:01 PM
Thank you much, Srinivas!
Now I need to play with them see if it there is one to help me get what I need.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-15-2013 09:21 AM
After trying the getting more info about Packages.com.glide.schedules.Schedule() / GlideSchedule() via the way provided by Srinivas Thelu (Many thanks again Srinivas!) I could still not find any method that could help me retrieve the Start and End date/times for the span matching my date/time.
However, SN Support got back to me in the meantime and after reiterating the fact that they don't support this they gave me the following useful info.
"... there does not appear to be anything in Schedule.java class that you can use. We do see that the ScheduleDateTimeSpan.java does have getStart() and getEnd() methods, and that's what we're using to compare in the isInSchedule() method. But this is not something that support would assist with. This would fall into the scope of professional services or perhaps reaching out to the community to see if others may have already gone down this road before."
So, I've tried Srinivas "hack" for Packages.com.glide.schedules.ScheduleDateTimeSpan() an did not get anything.
for(var members in new Packages.com.glide.schedules.ScheduleDateTimeSpan())
gs.print(members);
getting:
Javascript compiler exception: Java constructor for "com.glide.schedules.ScheduleDateTimeSpan" with arguments "" not found. (; line 1) in:
for(var members in new Packages.com.glide.schedules.ScheduleDateTimeSpan())
gs.print(members);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-30-2014 04:07 AM
Can you please provide that business rule where you have written getClassInfo function we will be obliged you.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-11-2014 09:51 AM
It certainly would be useful to have at least the function signatures of the undocumented Glide classes! I was looking for GlideSchedule* information which led me to this thread. I ran a background script to get a list of properties. It might help in the constant guessing game of how to use the platform's functionality. If anyone knows where to find more complete documentation for these classes, please add a link!
SCRIPT:
/*
Get properties of classes:
GlideSchedule
GlideScheduleDateTime
GlideScheduleDateTimeSpan
GlideScheduleTimeMap
*/
var s = new GlideScheduleDateTime();
_list("GlideSchedule", new GlideSchedule());
_list("GlideScheduleDateTime", new GlideScheduleDateTime());
_list("GlideScheduleDateTimeSpan",new GlideScheduleDateTimeSpan(s,s));
_list("GlideScheduleTimeMap", new GlideScheduleTimeMap());
function _list(c,g) {
var a = [];
for (p in g) {
a.push(p);
}
gs.print("\n\nSORTED PROPERTIES OF CLASS: "+c+"\n");
a.sort();
for (i=0; i<a.length; i++) {
gs.print(a[i]);
}
}
RESULTS:
[0:00:00.021] Script completed: script
*** Script: SORTED PROPERTIES OF CLASS: GlideSchedule
*** Script: ID
*** Script: add
*** Script: addOtherSchedule0
*** Script: addOtherScheduleById
*** Script: addTimeSpan
*** Script: addTimeSpanById
*** Script: addTimeSpans
*** Script: addTimeSpansExcluded
*** Script: addTimeSpansInclude
*** Script: class
*** Script: clear
*** Script: daysOfWeek
*** Script: duration
*** Script: empty
*** Script: equals
*** Script: getClass
*** Script: getDaysOfWeek
*** Script: getID
*** Script: getName
*** Script: getSpans
*** Script: getTimeMap
*** Script: getTimeZone
*** Script: hashCode
*** Script: isEmpty
*** Script: isInSchedule
*** Script: isValid
*** Script: isValidOther
*** Script: load
*** Script: loadOtherSchedules
*** Script: loadParentSchedule
*** Script: name
*** Script: notify
*** Script: notifyAll
*** Script: overlapsWith
*** Script: setTimeZone
*** Script: timeZone
*** Script: toString
*** Script: valid
*** Script: validOther
*** Script: wait
*** Script: whenLast
*** Script: whenNext
*** Script: SORTED PROPERTIES OF CLASS: GlideScheduleDateTime
*** Script: MS
*** Script: XMLValue
*** Script: addDays
*** Script: addSeconds
*** Script: after
*** Script: afterOwnerDelete
*** Script: afterOwnerInsert
*** Script: afterOwnerUpdate
*** Script: before
*** Script: cal
*** Script: changes
*** Script: class
*** Script: clear
*** Script: compareTo
*** Script: convertTimeZone
*** Script: displayValue
*** Script: displayValueInTZ
*** Script: displayValueInternal
*** Script: equals
*** Script: errorMsg
*** Script: floating
*** Script: getCal
*** Script: getChoices
*** Script: getClass
*** Script: getDisplayValue
*** Script: getDisplayValueInTZ
*** Script: getDisplayValueInternal
*** Script: getErrorMsg
*** Script: getGlideDateTime
*** Script: getHTMLValue
*** Script: getInitialValue
*** Script: getIntegerDate
*** Script: getIntegerTime
*** Script: getMS
*** Script: getPreviousValue
*** Script: getStorageValue
*** Script: getTimeZone
*** Script: getTimeZoneID
*** Script: getValue
*** Script: getXMLValue
*** Script: glideDateTime
*** Script: handlesChangeDetection
*** Script: handlesPreviousValueTracking
*** Script: hasChoices
*** Script: hashCode
*** Script: initialValue
*** Script: integerDate
*** Script: integerTime
*** Script: isFloating
*** Script: isNullValue
*** Script: isValid
*** Script: notify
*** Script: notifyAll
*** Script: nullValue
*** Script: previousValue
*** Script: setBeginningOfDay
*** Script: setCal
*** Script: setCalNoTZ
*** Script: setDisplayValue
*** Script: setDisplayValueInternal
*** Script: setElement
*** Script: setEndOfDay
*** Script: setGlideDateTime
*** Script: setIncludeZFormat
*** Script: setInitialValue
*** Script: setMS
*** Script: setTimeZone
*** Script: setValue
*** Script: setXMLValue
*** Script: storageValue
*** Script: timeZone
*** Script: timeZoneID
*** Script: toString
*** Script: toStringTZ
*** Script: value
*** Script: wait
*** Script: SORTED PROPERTIES OF CLASS: GlideScheduleDateTimeSpan
*** Script: adjacentTo
*** Script: class
*** Script: compareTo
*** Script: end
*** Script: equals
*** Script: getClass
*** Script: getEnd
*** Script: getStart
*** Script: hashCode
*** Script: notify
*** Script: notifyAll
*** Script: setEnd
*** Script: setStart
*** Script: setTimeZone
*** Script: start
*** Script: toString
*** Script: wait
*** Script: SORTED PROPERTIES OF CLASS: GlideScheduleTimeMap
*** Script: addExclude
*** Script: addExcludeSpans
*** Script: addInclude
*** Script: addIncludeSpans
*** Script: buildMap
*** Script: class
*** Script: clear
*** Script: dumpTimeMap
*** Script: dumpTimeMapTZ
*** Script: empty
*** Script: equals
*** Script: getClass
*** Script: getLast
*** Script: hasNext
*** Script: hashCode
*** Script: isEmpty
*** Script: last
*** Script: next
*** Script: notify
*** Script: notifyAll
*** Script: overlapsWith
*** Script: setTimeZone
*** Script: toString
*** Script: wait
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-11-2014 10:23 AM
Nice