- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2018 08:02 AM
Hi!
If someone has it, could someone share code that I can use in a background script that will list all the available methods for a given class? I know this existed but I can't seem to find it.
I really appreciate it.
Thanks!.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2018 08:18 AM
It works for me i just ran a quick background script.
Try this:
/*
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]);
}
}
Please mark my response as correct and helpful if it helped solved your question.
-Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2018 08:07 AM
Check this out, may this could give you some lead
https://community.servicenow.com/community?id=community_question&sys_id=cf4d8fa9db9cdbc01dcaf3231f9619f9
Please mark my response as correct and helpful if it helped solved your question.
-Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2018 08:10 AM
Hi Prateek,
Thank you for the quick reply. I did check out the article you provided. Unfortunately, the code listed towards the bottom of the discussion did not work for me.
Thanks,
Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2018 08:18 AM
It works for me i just ran a quick background script.
Try this:
/*
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]);
}
}
Please mark my response as correct and helpful if it helped solved your question.
-Thanks