Update System Global API authored by Connor Quick's avatar Connor Quick
...@@ -23,7 +23,7 @@ session. ...@@ -23,7 +23,7 @@ session.
addErrorMessage("This is an error message."); addErrorMessage("This is an error message.");
``` ```
## `addInfoMessage(String message)` ## *`addInfoMessage(String message)`*
### Description ### Description
...@@ -39,7 +39,7 @@ The `addInfoMessage` method takes a string as an input and adds it as an informa ...@@ -39,7 +39,7 @@ The `addInfoMessage` method takes a string as an input and adds it as an informa
addInfoMessage("This is an informational message."); addInfoMessage("This is an informational message.");
``` ```
## `base64Decode(String source)` ## *`base64Decode(String source)`*
### Description ### Description
...@@ -55,7 +55,7 @@ Returns an ASCII string from the specified base64 string. ...@@ -55,7 +55,7 @@ Returns an ASCII string from the specified base64 string.
let asciiString = base64Decode("SGVsbG8gd29ybGQ="); let asciiString = base64Decode("SGVsbG8gd29ybGQ=");
``` ```
## `base64Encode(String source)` ## *`base64Encode(String source)`*
### Description ### Description
...@@ -71,7 +71,7 @@ Creates a base64 string from the specified string. ...@@ -71,7 +71,7 @@ Creates a base64 string from the specified string.
let base64String = base64Encode("Hello world"); let base64String = base64Encode("Hello world");
``` ```
## `beginningOfLastMonth()` ## *`beginningOfLastMonth()`*
### Description ### Description
...@@ -83,7 +83,7 @@ Returns the date and time for the beginning of last month in GMT. ...@@ -83,7 +83,7 @@ Returns the date and time for the beginning of last month in GMT.
let beginningLastMonth = beginningOfLastMonth(); let beginningLastMonth = beginningOfLastMonth();
``` ```
## `beginningOfLastWeek()` ## *`beginningOfLastWeek()`*
### Description ### Description
...@@ -95,7 +95,7 @@ Returns the date and time for the beginning of last week in GMT. ...@@ -95,7 +95,7 @@ Returns the date and time for the beginning of last week in GMT.
let beginningLastWeek = beginningOfLastWeek(); let beginningLastWeek = beginningOfLastWeek();
``` ```
## `beginningOfNextMonth()` ## *`beginningOfNextMonth()`*
### Description ### Description
...@@ -107,7 +107,7 @@ Returns the date and time for the beginning of next month in GMT. ...@@ -107,7 +107,7 @@ Returns the date and time for the beginning of next month in GMT.
let beginningNextMonth = beginningOfNextMonth(); let beginningNextMonth = beginningOfNextMonth();
``` ```
## `beginningOfNextWeek()` ## *`beginningOfNextWeek()`*
### Description ### Description
...@@ -119,7 +119,7 @@ Returns the date and time for the beginning of next week in GMT. ...@@ -119,7 +119,7 @@ Returns the date and time for the beginning of next week in GMT.
let beginningNextWeek = beginningOfNextWeek(); let beginningNextWeek = beginningOfNextWeek();
``` ```
## `beginningOfNextYear()` ## *`beginningOfNextYear()`*
### Description ### Description
...@@ -131,7 +131,7 @@ Returns the date and time for the beginning of next year in GMT. ...@@ -131,7 +131,7 @@ Returns the date and time for the beginning of next year in GMT.
let beginningNextYear = beginningOfNextYear(); let beginningNextYear = beginningOfNextYear();
``` ```
## `beginningOfThisMonth()` ## *`beginningOfThisMonth()`*
### Description ### Description
...@@ -143,7 +143,7 @@ Returns the date and time for the beginning of this month in GMT. ...@@ -143,7 +143,7 @@ Returns the date and time for the beginning of this month in GMT.
let beginningThisMonth = beginningOfThisMonth(); let beginningThisMonth = beginningOfThisMonth();
``` ```
## `beginningOfThisQuarter()` ## *`beginningOfThisQuarter()`*
### Description ### Description
...@@ -155,7 +155,7 @@ Returns the date and time for the beginning of this quarter in GMT. ...@@ -155,7 +155,7 @@ Returns the date and time for the beginning of this quarter in GMT.
let beginningThisQuarter = beginningOfThisQuarter(); let beginningThisQuarter = beginningOfThisQuarter();
``` ```
## `beginningOfThisWeek()` ## *`beginningOfThisWeek()`*
### Description ### Description
...@@ -167,7 +167,7 @@ Returns the date and time for the beginning of this week in GMT. ...@@ -167,7 +167,7 @@ Returns the date and time for the beginning of this week in GMT.
let beginningThisWeek = beginningOfThisWeek(); let beginningThisWeek = beginningOfThisWeek();
``` ```
## `beginningOfThisYear()` ## *`beginningOfThisYear()`*
### Description ### Description
...@@ -179,7 +179,7 @@ Returns the date and time for the beginning of this year in GMT. ...@@ -179,7 +179,7 @@ Returns the date and time for the beginning of this year in GMT.
let beginningThisYear = beginningOfThisYear(); let beginningThisYear = beginningOfThisYear();
``` ```
## `daysAgo(Number days)` ## *`daysAgo(Number days)`*
### Description ### Description
...@@ -195,7 +195,7 @@ Returns the date and time for a specified number of days ago. ...@@ -195,7 +195,7 @@ Returns the date and time for a specified number of days ago.
let daysAgo = daysAgo(3); let daysAgo = daysAgo(3);
``` ```
## `daysAgoEnd(Number days)` ## *`daysAgoEnd(Number days)`*
### Description ### Description
...@@ -211,7 +211,7 @@ Returns the date and time for the end of the day a specified number of days ago. ...@@ -211,7 +211,7 @@ Returns the date and time for the end of the day a specified number of days ago.
let endOfDay = daysAgoEnd(3); let endOfDay = daysAgoEnd(3);
``` ```
## `daysAgoStart(Number days)` ## *`daysAgoStart(Number days)`*
### Description ### Description
...@@ -227,7 +227,7 @@ Returns the date and time for the beginning of the day a specified number of day ...@@ -227,7 +227,7 @@ Returns the date and time for the beginning of the day a specified number of day
let startOfDay = daysAgoStart(3); let startOfDay = daysAgoStart(3);
``` ```
## `debug(String message)` ## *`debug(String message)`*
### Description ### Description
...@@ -243,7 +243,7 @@ Writes a debug message to the system log. ...@@ -243,7 +243,7 @@ Writes a debug message to the system log.
debug("This is a debug message"); debug("This is a debug message");
``` ```
## `endOfLastMonth()` ## *`endOfLastMonth()`*
### Description ### Description
...@@ -255,7 +255,7 @@ Returns the date and time for the end of last month in GMT. ...@@ -255,7 +255,7 @@ Returns the date and time for the end of last month in GMT.
let endOfLastMonth = endOfLastMonth(); let endOfLastMonth = endOfLastMonth();
``` ```
## `endOfLastWeek()` ## *`endOfLastWeek()`*
### Description ### Description
...@@ -267,7 +267,7 @@ Returns the date and time for the end of last week in GMT. ...@@ -267,7 +267,7 @@ Returns the date and time for the end of last week in GMT.
let endOfLastWeek = endOfLastWeek(); let endOfLastWeek = endOfLastWeek();
``` ```
## `endOfLastYear()` ## *`endOfLastYear()`*
### Description ### Description
...@@ -279,7 +279,7 @@ Returns the date and time for the end of last year in GMT. ...@@ -279,7 +279,7 @@ Returns the date and time for the end of last year in GMT.
let endOfLastYear = endOfLastYear(); let endOfLastYear = endOfLastYear();
``` ```
## `endOfNextMonth()` ## *`endOfNextMonth()`*
### Description ### Description
...@@ -291,7 +291,7 @@ Returns the date and time for the end of next month in GMT. ...@@ -291,7 +291,7 @@ Returns the date and time for the end of next month in GMT.
let endOfNextMonth = endOfNextMonth(); let endOfNextMonth = endOfNextMonth();
``` ```
## `endOfNextWeek()` ## *`endOfNextWeek()`*
### Description ### Description
...@@ -303,7 +303,7 @@ Returns the date and time for the end of next week in GMT. ...@@ -303,7 +303,7 @@ Returns the date and time for the end of next week in GMT.
let endOfNextWeek = endOfNextWeek(); let endOfNextWeek = endOfNextWeek();
``` ```
## `endOfNextYear()` ## *`endOfNextYear()`*
### Description ### Description
...@@ -315,7 +315,7 @@ Returns the date and time for the end of next year in GMT. ...@@ -315,7 +315,7 @@ Returns the date and time for the end of next year in GMT.
let endOfNextYear = endOfNextYear() let endOfNextYear = endOfNextYear()
``` ```
## `endOfThisMonth()` ## *`endOfThisMonth()`*
### Description ### Description
...@@ -327,7 +327,7 @@ Returns the date and time for the end of this month in GMT. ...@@ -327,7 +327,7 @@ Returns the date and time for the end of this month in GMT.
let endOfThisMonth = endOfThisMonth(); let endOfThisMonth = endOfThisMonth();
``` ```
## `endOfThisQuarter()` ## *`endOfThisQuarter()`*
### Description ### Description
...@@ -339,7 +339,7 @@ Returns the date and time for the end of this quarter in GMT. ...@@ -339,7 +339,7 @@ Returns the date and time for the end of this quarter in GMT.
let endOfThisQuarter = endOfThisQuarter(); let endOfThisQuarter = endOfThisQuarter();
``` ```
## `endOfThisWeek()` ## *`endOfThisWeek()`*
### Description ### Description
...@@ -351,7 +351,7 @@ Returns the date and time for the end of this week in GMT. ...@@ -351,7 +351,7 @@ Returns the date and time for the end of this week in GMT.
let endOfThisWeek = endOfThisWeek(); let endOfThisWeek = endOfThisWeek();
``` ```
## `endOfThisYear()` ## *`endOfThisYear()`*
### Description ### Description
...@@ -363,7 +363,7 @@ Returns the date and time for the end of this year in GMT. ...@@ -363,7 +363,7 @@ Returns the date and time for the end of this year in GMT.
let endOfThisYear = endOfThisYear(); let endOfThisYear = endOfThisYear();
``` ```
## `error(String message)` ## *`error(String message)`*
### Parameters ### Parameters
...@@ -379,7 +379,7 @@ Writes an error message to the system log. ...@@ -379,7 +379,7 @@ Writes an error message to the system log.
error("This is an error message"); error("This is an error message");
``` ```
## `eventQueue(String name, Object instance, String parm1, String parm2, String queue)` ## *`eventQueue(String name, Object instance, String parm1, String parm2, String queue)`*
### Parameters ### Parameters
...@@ -399,7 +399,7 @@ Queues an event for the event manager. ...@@ -399,7 +399,7 @@ Queues an event for the event manager.
eventQueue("eventName", instanceObject, "parameter1", "parameter2", "queueName"); eventQueue("eventName", instanceObject, "parameter1", "parameter2", "queueName");
``` ```
## `eventQueueScheduled(String name, Object instance, String parm1, String parm2, Object expiration)` ## *`eventQueueScheduled(String name, Object instance, String parm1, String parm2, Object expiration)`*
### Parameters ### Parameters
...@@ -419,7 +419,7 @@ Queues an event in the event manager. The passed in event schedule information i ...@@ -419,7 +419,7 @@ Queues an event in the event manager. The passed in event schedule information i
eventQueueScheduled("eventName", instanceObject, "parameter1", "parameter2", expirationObject); eventQueueScheduled("eventName", instanceObject, "parameter1", "parameter2", expirationObject);
``` ```
## `generateGUID()` ## *`generateGUID()`*
### Description ### Description
...@@ -431,7 +431,7 @@ Generates a GUID that can be used when a unique identifier is required. ...@@ -431,7 +431,7 @@ Generates a GUID that can be used when a unique identifier is required.
let guid = generateGUID(); let guid = generateGUID();
``` ```
## `getErrorMessages()` ## *`getErrorMessages()`*
### Description ### Description
...@@ -443,7 +443,7 @@ Returns the error messages that were added by addErrorMessage() for the session. ...@@ -443,7 +443,7 @@ Returns the error messages that were added by addErrorMessage() for the session.
let errorMessages = getErrorMessages(); let errorMessages = getErrorMessages();
``` ```
## `getProperty(String key, Object alt)` ## *`getProperty(String key, Object alt)`*
### Parameters ### Parameters
...@@ -460,7 +460,7 @@ Gets the value of a system property from sys_properties. If the property is not ...@@ -460,7 +460,7 @@ Gets the value of a system property from sys_properties. If the property is not
let propertyValue = getProperty("propertyKey", "alternateValue"); let propertyValue = getProperty("propertyKey", "alternateValue");
``` ```
## `getTimeZoneName()` ## *`getTimeZoneName()`*
### Description ### Description
...@@ -472,7 +472,7 @@ Returns the name of the time zone associated with the current user. ...@@ -472,7 +472,7 @@ Returns the name of the time zone associated with the current user.
let timeZoneName = getTimeZoneName(); let timeZoneName = getTimeZoneName();
``` ```
## `getUrlOnStack()` ## *`getUrlOnStack()`*
### Description ### Description
...@@ -484,7 +484,7 @@ Gets the current URI for the session. ...@@ -484,7 +484,7 @@ Gets the current URI for the session.
let url = getUrlOnStack(); let url = getUrlOnStack();
``` ```
## `getUser()` ## *`getUser()`*
### Description ### Description
...@@ -496,7 +496,7 @@ Returns a reference to the scoped SystemUser object for the current user. ...@@ -496,7 +496,7 @@ Returns a reference to the scoped SystemUser object for the current user.
let user = getUser(); let user = getUser();
``` ```
## `getUserDisplayName()` ## *`getUserDisplayName()`*
### Description ### Description
...@@ -508,7 +508,7 @@ Gets the display name of the current user. ...@@ -508,7 +508,7 @@ Gets the display name of the current user.
let displayName = getUserDisplayName(); let displayName = getUserDisplayName();
``` ```
## `getUserID()` ## *`getUserID()`*
### Description ### Description
...@@ -520,7 +520,7 @@ Gets the id of the current user. ...@@ -520,7 +520,7 @@ Gets the id of the current user.
let userId = getUserID(); let userId = getUserID();
``` ```
## `getUserName()` ## *`getUserName()`*
### Description ### Description
...@@ -532,7 +532,7 @@ Gets the user name, or user id, of the current user. ...@@ -532,7 +532,7 @@ Gets the user name, or user id, of the current user.
let userName = getUserName(); let userName = getUserName();
``` ```
## `hasRole(role)` ## *`hasRole(role)`*
### Description ### Description
...@@ -548,7 +548,7 @@ Determines if the current user has the specified role. ...@@ -548,7 +548,7 @@ Determines if the current user has the specified role.
let hasRoleAdmin = hasRole('admin'); let hasRoleAdmin = hasRole('admin');
``` ```
## `hoursAgo(hours)` ## *`hoursAgo(hours)`*
### Description ### Description
...@@ -564,7 +564,7 @@ Returns the date and time for a specified number of hours ago. ...@@ -564,7 +564,7 @@ Returns the date and time for a specified number of hours ago.
let timeFewHoursAgo = hoursAgo(3); let timeFewHoursAgo = hoursAgo(3);
``` ```
## `hoursAgoEnd(hours)` ## *`hoursAgoEnd(hours)`*
### Description ### Description
...@@ -580,7 +580,7 @@ Returns the date and time for the end of the hour a specified number of hours ag ...@@ -580,7 +580,7 @@ Returns the date and time for the end of the hour a specified number of hours ag
let timeHoursAgoEnd = hoursAgoEnd(3); let timeHoursAgoEnd = hoursAgoEnd(3);
``` ```
## `hoursAgoStart(hours)` ## *`hoursAgoStart(hours)`*
### Description ### Description
...@@ -596,7 +596,7 @@ Returns the date and time for the start of the hour a specified number of hours ...@@ -596,7 +596,7 @@ Returns the date and time for the start of the hour a specified number of hours
let timeHoursAgoStart = hoursAgoStart(3); let timeHoursAgoStart = hoursAgoStart(3);
``` ```
## `include(name)` ## *`include(name)`*
### Description ### Description
...@@ -612,7 +612,7 @@ Provides a safe way to call a script include from the sandbox, allowing only the ...@@ -612,7 +612,7 @@ Provides a safe way to call a script include from the sandbox, allowing only the
include('myScript'); include('myScript');
``` ```
## `info(message)` ## *`info(message)`*
### Description ### Description
...@@ -628,7 +628,7 @@ Writes an info message to the system log. ...@@ -628,7 +628,7 @@ Writes an info message to the system log.
info('This is an info message.'); info('This is an info message.');
``` ```
## `minutesAgoEnd(minutes)` ## *`minutesAgoEnd(minutes)`*
### Description ### Description
...@@ -644,7 +644,7 @@ Returns the date and time for the end of the minute a specified number of minute ...@@ -644,7 +644,7 @@ Returns the date and time for the end of the minute a specified number of minute
let timeMinutesAgoEnd = minutesAgoEnd(30); let timeMinutesAgoEnd = minutesAgoEnd(30);
``` ```
## `minutesAgoStart(minutes)` ## *`minutesAgoStart(minutes)`*
### Description ### Description
...@@ -660,7 +660,7 @@ Returns the date and time for the start of the minute a specified number of minu ...@@ -660,7 +660,7 @@ Returns the date and time for the start of the minute a specified number of minu
let timeMinutesAgoStart = minutesAgoStart(30); let timeMinutesAgoStart = minutesAgoStart(30);
``` ```
## `monthsAgo(months)` ## *`monthsAgo(months)`*
### Description ### Description
...@@ -676,7 +676,7 @@ Returns the date and time for a specified number of months ago. ...@@ -676,7 +676,7 @@ Returns the date and time for a specified number of months ago.
let timeMonthsAgo = monthsAgo(3); let timeMonthsAgo = monthsAgo(3);
``` ```
## `monthsAgoStart(months)` ## *`monthsAgoStart(months)`*
### Description ### Description
...@@ -692,7 +692,7 @@ Returns the date and time for the start of the month a specified number of month ...@@ -692,7 +692,7 @@ Returns the date and time for the start of the month a specified number of month
let timeMonthsAgoStart = monthsAgoStart(3); let timeMonthsAgoStart = monthsAgoStart(3);
``` ```
## `nil(o)` ## *`nil(o)`*
### Description ### Description
...@@ -708,7 +708,7 @@ Queries an object and returns true if the object is null, undefined, or contains ...@@ -708,7 +708,7 @@ Queries an object and returns true if the object is null, undefined, or contains
let isNull = nil(myObject); let isNull = nil(myObject);
``` ```
## `quartersAgoEnd(quarters)` ## *`quartersAgoEnd(quarters)`*
### Description ### Description
...@@ -724,7 +724,7 @@ Returns the date and time for the last day of the quarter for a specified number ...@@ -724,7 +724,7 @@ Returns the date and time for the last day of the quarter for a specified number
let timeQuartersAgoEnd = quartersAgoEnd(2); let timeQuartersAgoEnd = quartersAgoEnd(2);
``` ```
## `quartersAgoStart(quarters)` ## *`quartersAgoStart(quarters)`*
### Description ### Description
...@@ -740,7 +740,7 @@ Returns the date and time for the first day of the quarter for a specified numbe ...@@ -740,7 +740,7 @@ Returns the date and time for the first day of the quarter for a specified numbe
let timeQuartersAgoStart = quartersAgoStart(2); let timeQuartersAgoStart = quartersAgoStart(2);
``` ```
## `setProperty(key, value, description)` ## *`setProperty(key, value, description)`*
### Description ### Description
...@@ -758,7 +758,7 @@ Sets the specified key to the specified value if the property is within the scri ...@@ -758,7 +758,7 @@ Sets the specified key to the specified value if the property is within the scri
setProperty('myKey', 'myValue', 'This is a property description'); setProperty('myKey', 'myValue', 'This is a property description');
``` ```
## `setRedirect(o)` ## *`setRedirect(o)`*
### Description ### Description
...@@ -774,7 +774,7 @@ Sets the redirect URI for this transaction, which then determines the next page ...@@ -774,7 +774,7 @@ Sets the redirect URI for this transaction, which then determines the next page
setRedirect(myURI); setRedirect(myURI);
``` ```
## `tableExists(name)` ## *`tableExists(name)`*
### Description ### Description
...@@ -790,7 +790,7 @@ Determines if a database table exists. ...@@ -790,7 +790,7 @@ Determines if a database table exists.
let doesTableExist = tableExists('myTable'); let doesTableExist = tableExists('myTable');
``` ```
## `urlDecode(url)` ## *`urlDecode(url)`*
### Description ### Description
...@@ -806,7 +806,7 @@ Replaces UTF-8 encoded characters with ASCII characters. ...@@ -806,7 +806,7 @@ Replaces UTF-8 encoded characters with ASCII characters.
let decodedUrl = urlDecode('https%3A%2F%2Fexample.com'); let decodedUrl = urlDecode('https%3A%2F%2Fexample.com');
``` ```
## `urlEncode(url)` ## *`urlEncode(url)`*
### Description ### Description
...@@ -822,7 +822,7 @@ Encodes non-ASCII characters, unsafe ASCII characters, and spaces so the returne ...@@ -822,7 +822,7 @@ Encodes non-ASCII characters, unsafe ASCII characters, and spaces so the returne
let encodedUrl = urlEncode('https://example.com'); let encodedUrl = urlEncode('https://example.com');
``` ```
## `warn(message)` ## *`warn(message)`*
### Description ### Description
...@@ -838,7 +838,7 @@ Writes a warning message to the system log. ...@@ -838,7 +838,7 @@ Writes a warning message to the system log.
warn('This is a warning message'); warn('This is a warning message');
``` ```
## `xmlToJSON(xmlString)` ## *`xmlToJSON(xmlString)`*
### Description ### Description
...@@ -854,7 +854,7 @@ Takes an XML string and returns a JSON object. ...@@ -854,7 +854,7 @@ Takes an XML string and returns a JSON object.
let jsonObject = xmlToJSON('<root><test>value</test></root>'); let jsonObject = xmlToJSON('<root><test>value</test></root>');
``` ```
## `yearsAgo(years)` ## *`yearsAgo(years)`*
### Description ### Description
...@@ -870,7 +870,7 @@ Returns a date and time for a certain number of years ago. ...@@ -870,7 +870,7 @@ Returns a date and time for a certain number of years ago.
let timeYearsAgo = yearsAgo(5); let timeYearsAgo = yearsAgo(5);
``` ```
## `yesterday()` ## *`yesterday()`*
### Description ### Description
... ...
......