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