GlideSystem Flashcards

The scoped GlideSystem (referred to by the variable name 'gs' in any server-side JavaScript) API provides a number of convenient methods to get information about the system, the current logged in user, etc. Many of the GlideSystem methods facilitate the easy inclusion of dates in query ranges, and are most often used in filters and reporting.

1
Q

What does gs stand for?

A

GlideSystem

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What type of information does gs give you access to?

A

Provides a number of convenient methods to get information about the system, the current logged in user, etc.
Many of the GlideSystem methods facilitate the easy inclusion of dates in query ranges, and are most often used in filters and reporting.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Adds an error message for the current session in Server Script

A

gs.addErrorMessage(String message)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Adds an info message for the current session in Server Script (This method is not supported for asynchronous business rules)

A

gs.addInfoMessage(String message)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Decodes a base64 string in Server Script

A

gs.base64Decode(String source)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Encodes into a base64 string in Server Script

A

gs.base64Encode(String source)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Returns the date and time for the beginning of last month in GMT in Server Script

A

gs.beginningOfLastMonth()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Returns the date and time for the beginning of last week in GMT in Server Script

A

gs.beginningOfLastWeek()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Returns the date and time for the beginning of next month in GMT in Server Script

A

gs.beginningOfNextMonth()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Returns the date and time for the beginning of next week in GMT in Server Script

A

gs.beginningOfNextWeek()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Returns the date and time for the beginning of next year in GMT in Server Script

A

gs.beginningOfNextYear()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Returns the date and time for the beginning of this month in GMT in Server Script

A

gs.beginningOfThisMonth()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Returns the date and time for the beginning of this quarter in GMT in Server Script

A

gs.beginningOfThisQuarter()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Returns the date and time for the beginning of this week in GMT in Server Script

A

gs.beginningOfThisWeek()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Returns the date and time for the beginning of this year in GMT in Server Script

A

gs.beginningOfThisYear()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Generates a date and time for the specified date in GMT in Server Script

A

gs.dateGenerate(String date, String range)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Returns the date and time for a specified number of days ago in Server Script

A

gs.daysAgo(Number days)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Returns the date and time for the end of the day a specified number of days ago in Server Script

A

gs.daysAgoEnd(Number days)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Returns the date and time for the beginning of the day a specified number of days ago in Server Script

A

gs.daysAgoStart(Number days)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Writes a debug message to the system log in Server Script

A

gs.debug(String message, Object parm1, Object parm2, Object parm3, Object parm4, Object parm5)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Returns the date and time for the end of last month in GMT in Server Script

A

gs.endOfLastMonth()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Returns the date and time for the end of last week in GMT in Server Script

A

gs.endOfLastWeek()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Returns the date and time for the end of last year in GMT in Server Script

A

gs.endOfLastYear()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

Returns the date and time for the end of next month in GMT in Server Script

A

gs.endOfNextMonth()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

Returns the date and time for the end of next week in GMT in Server Script

A

gs.endOfNextWeek()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

Returns the date and time for the end of next year in GMT in Server Script

A

gs.endOfNextYear()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

Returns the date and time for the end of this month in GMT in Server Script

A

gs.endOfThisMonth()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

Returns the date and time for the end of this quarter in GMT in Server Script

A

gs.endOfThisQuarter()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

Returns the date and time for the end of this week in GMT in Server Script

A

gs.endOfThisWeek()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

Returns the date and time for the end of this year in GMT in Server Script

A

gs.endOfThisYear()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

Writes an error message to the system log in Server Script

A

gs.error(String message, Object parm1, Object parm2, Object parm3, Object parm4, Object parm5)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

Queues an event for the event manager in Server Script

A

eventQueue(String name, Object instance, String parm1, String parm2, String queue)

33
Q

Queues an event in the event manager with event schedule in Server Script

A

gs.eventQueueScheduled(String name, Object instance, String parm1, String parm2, Object expiration)

34
Q

Executes a job for a scoped application in Server Script

A

gs.executeNow(GlideRecord job)

35
Q

Generates a GUID that can be used when a unique identifier is required in Server Script

A

gs.generateGUID()

36
Q

Gets the caller scope name in Server Script; returns null if there is no caller

A

gs.getCallerScopeName()

37
Q

Gets a string representing the cache version for a CSS file in Server Script

A

gs.getCssCacheVersionString()

When would you use this??

38
Q

Gets the ID of the current application as set using the Application Picker in Server Script

A

gs.getCurrentApplicationId()

39
Q

Gets the name of the current scope in Server Script

A

gs.getCurrentScopeName()

40
Q

Returns the list of error messages for the session that were added by addErrorMessage() in Server Script

A

gs.getErrorMessages()

41
Q

Retrieves the specified message from the Message [sys_ui_message] table in Server Script. If the message has HTML special characters, replaces them with the corresponding HTML name codes. For example, & becomes &.

A

gs.getEscapedMessage(String id, Array args)

42
Q

Retrieves translated messages from the Message [sys_ui_message] table to display in a UI in Server Script

A

gs.getMessage(String id, Array args)

43
Q

If the UI message has a tick (‘), there may be issues with the message in the script; to escape the ticks (‘). What would you use in Server Script?

A

gs.getMessageS(String, Object)

44
Q

Gets the value of a Glide property in Server Script. If the property is not found, returns an alternate value.

A

gs.getProperty(String key, Object alt)

45
Q

Gets a reference to the current Glide session in Server Script

A

gs.getSession()

46
Q

Retrieves the GlideSession session ID in Server Script

A

gs.getSessionID()

47
Q

Retrieves the GlideSession session token in Server Script

A

gs.getSession().getSessionToken()

48
Q

Returns the name of the time zone associated with the current user in Server Script

A

gs.getSession().getTimeZoneName()

49
Q

Gets the current URI for the session in Server Script

A

gs.getUrlOnStack()

50
Q

Returns a reference to the scoped GlideUser object for the current user in Server Script

A

gs.getUser()

51
Q

Gets the display name of the current user in Server Script

A

gs.getUserDisplayName()

52
Q

Gets the sys_id of the current user in Server Script

A

gs.getUserID()

53
Q

Gets the user name, or user id, of the current user in Server Script

A

gs.getUserName()

54
Q

Determines if the current user has the specified role in Server Script

A

gs.hasRole(Object role)

55
Q

Returns the date and time for a specified number of hours ago in Server Script

A

gs.hoursAgo(Number hours)

56
Q

Returns the date and time for the end of the hour a specified number of hours ago in Server Script

A

gs.hoursAgoEnd(Number hours)

57
Q

Returns the date and time for the start of the hour a specified number of hours ago in Server Script

A

gs.hoursAgoStart(Number hours)

58
Q

Provides a safe way to call from the sandbox, allowing only the inclusion of trusted scripts in Server Script

A

gs.include(String name)

59
Q

Writes an info message to the system log in Server Script

A

gs.info(String message, Object parm1, Object parm2, Object parm3, Object parm4, Object parm5)

60
Q

Determines if debugging is active for a specific scoped in Server Script

A

gs.isDebugging()

61
Q

Checks if the current session is interactive in Server Script.

An example of an interactive session is when a user logs in normally. An example of a non-interactive session is using a SOAP request to retrieve data.

A

gs.isInteractive()

62
Q

Determines if the current user is currently logged-in in Server Script

A

gs.isLoggedIn()

63
Q

Determines if a request comes from a mobile device in Server Script

A

gs.isMobile()

This method can be used in UI action conditions and business rules.

64
Q

Returns the date and time for the end of the minute a specified number of minutes ago in Server Script

A

gs.minutesAgoEnd(Number minutes)

65
Q

Returns the date and time for the start of the minute a specified number of minutes ago in Server Script

A

gs.minutesAgoStart(Number minutes)

66
Q

Returns the date and time for a specified number of months ago in Server Script

A

gs.monthsAgo(Number months)

67
Q

Returns the date and time for the start of the month a specified number of months ago in Server Script

A

gs.monthsAgoStart(Number months)

68
Q

Queries an object and returns true if the object is null, undefined, or contains an empty string in Server Script

A

gs.nil(Object o)

69
Q

Returns the date and time for the last day of the quarter for a specified number of quarters ago in Server Script

A

gs.quartersAgoEnd(Number quarters)

70
Q

Returns the date and time for the first day of the quarter for a specified number of quarters ago in Server Script

A

gs.quartersAgoStart(Number quarters)

71
Q

Sets the specified key to the specified value if the property is within the script’s scope in Server Script

A

gs.setProperty(String key, String value, String description)

Causes a system wide cache flush

72
Q

Sets the redirect URI for this transaction, which then determines the next page the user will see in Server Script

A

gs.setRedirect(Object o)

73
Q

Determines if a database table exists in Server Script

A

gs.tableExists(String name)

74
Q

Replaces UTF-8 encoded characters with ASCII characters in Server Script

A

gs.urlDecode(String url)

75
Q

Encodes non-ASCII characters, unsafe ASCII characters, and spaces so the returned string can be used on the Internet. Uses UTF-8 encoding. Uses percent (%) encoding in Server Script

A

gs.urlEncode(String url)

76
Q

Writes a warning message to the system log in Server Script

A

gs.warn(String message, Object parm1, Object parm2, Object parm3, Object parm4, Object parm5)

77
Q

Takes an XML string and returns a JSON object in Server Script

A

gs.xmlToJSON(String xmlString)

78
Q

Returns a date and time for a certain number of years ago in Server Script

A

gs.yearsAgo(Number years)

79
Q

Returns yesterday’s time (24 hours ago) in Server Script

A

gs.yesterday()