call System.LogLocation("Work order started");
Logs the users GPS location with a comment. Logging will only happen if the user accepts location usage in the device and the application parameters allow it. The actual logging of the users location will happen asynchronously after the procedure successfully completes. This makes sure the client database is not locked for long periods of time.
call System.CreateGuid() into MyGuid;
Generates and returns a new GUID that contains 32 alphanumeric characters. For example, 86DFA50C48F64A30918D76DC81B16E97.
call System.GetParameter("MyParameter") into MyVariable;
Gets an application parameter value for a parameter defined in the app model. The parameter value can be changed in the Application Parameters screen in EE.
// variable Steps List<Structure(SurveyStep)>; // variable Item Structure(SurveyStep); call List.Add(Steps, Item);
Adds an item to a list variable.
// variable Steps List<Structure(SurveyStep)>; // variable Item Structure(SurveyStep); call List.Remove(Steps, Item);
Removes an item from a list variable.
// variable Steps List<Structure(SurveyStep)>; call List.Add(Steps);
Removes all items from a list variable.
// variable Steps List<Structure(SurveyStep)>; // variable ListCount Integer; call List.Count(Steps) into ListCount;
Adds an item to a list variable.
// variable Names List<Text>; // variable Name Text; call List.Get(Names, 5) into Name;
Returns an item at the specified zero based index in the list.
// variable Names List<Text>; // variable Index Integer; call List.IndexOf(Names, "John") into Index;
Returns the zero based index of an item within a list. Returns < 0 if the item is not found.
call DateTime.Timestamp() into Result;
Gets the current timestamp.
call DateTime.Timestamp(2018, 4, 18, 12, 10, 0) into Result;
Creates a timestamp from the supplied parameters.
call DateTime.Date() into Result;
Gets the current date.
call DateTime.Date(Attrib) into Result;
Returns the timestamp with the time portion set to 00:00:00.
call DateTime.Date(2018, 4, 18) into Result;
Creates a date from the supplied parameters.
call DateTime.Time(Attrib) into Result;
Returns the time from a timestamp.
call DateTime.Time(12, 10, 0) into Result;
Creates a time from the supplied parameters.
call DateTime.AddYears(Attrib, 2) into Result;
Adds years to the supplied timestamp.
call DateTime.AddMonths(Attrib, 3) into Result;
Adds months to the supplied timestamp.
call DateTime.AddDays(Attrib, 3) into Result; call DateTime.AddDays(Attrib, 3.4) into Result;
Adds days to the supplied timestamp. Fractional days are supported.
call DateTime.AddHours(Attrib, 3) into Result; call DateTime.AddHours(Attrib, 3.4) into Result;
Adds hours to the supplied timestamp. Fractional hours are supported.
call DateTime.AddMinutes(Attrib, 3) into Result; call DateTime.AddMinutes(Attrib, 3.4) into Result;
Adds minutes to the supplied timestamp. Fractional minutes are supported.
call DateTime.AddMinutes(Attrib, 30) into Result;
Adds seconds to the supplied timestamp.
call DateTime.DifferenceInDays(AttribA, AttribB) into Result;
Calculated the difference between two timestamps in days as a fractional number.
call DateTime.DifferenceInHours(AttribA, AttribB) into Result;
Calculated the difference between two timestamps in hours as a fractional number.
call String.Length("abcde") into Result; // "5"
Returns the length of a string
call String.Trim(" MyValue ") into Result; // "MyValue" call String.Trim("#MyValue ", "#") into Result; // "MyValue " call String.Trim("MyValue ", null) into Result; // null call String.Trim("MyValue ", "") into Result; // null call String.TrimEnd("#MyValue#", "#") into Result; // "#MyValue"
Removes characters from the start or end of strings Note: if the char parameter is null or empty the Trim functions will return null.
call String.ToUpper("MyValue") into Result; // "MYVALUE"
Converts a string to upper case
call String.ToLower("MyValue") into Result; // "myvalue"
Converts a string to lower case
call String.Like("123456", "12_45") into Result; // true call String.Like("023456", "12_45") into Result; // false call String.Like("023456", "%45") into Result; // true call String.Like("cat house dog", "%house%") into Result; // true call String.Like("cat HOUSE dog", "%house%") into Result; // true call String.Like("123456", null) into Result; // false
Compares two strings. % will match any number of characters, _ will match any single character. Strings are compared case-insensitive. Note: if the pattern is null or empty, the method will return false
call String.Replace("123456", "34", "##") into Result; // "12##56" call String.Replace("abABab", "b", "#") into Result; // "a#ABa#" call String.Replace("12345", null, "#") into Result; // 12345 call String.Replace("123456", "34", null) into Result; // 1256
Replaces all occurrences of searchString with replacementString. Note: - If searchString is null, the original string is returned - If replacementString is null, the searchString is removed from the original string
call String.RegexLike("abcde", "ab[ch]de") into Result; // true call String.RegexLike("abhde", "ab[ch]de") into Result; // true call String.RegexLike("abab", "ABAB") into Result; // false call String.RegexLike("abab", null) into Result; // false call String.RegexLike("abab", "ABAB", "i") into Result; // true
Compares two strings using regular expressions. Note: if the pattern is null, the result is false.
call String.RegexReplace("abcac", "c", "d",) into Result; // "abdad" call String.RegexReplace("abcac", null, "d",) into Result; // "abcac" call String.RegexReplace("abCac", "c", "d",) into Result; // "abCad" call String.RegexReplace("abCac", "c", "d", "i") into Result; // "abdad"
Replaces all occurrences of pattern with replacementString. Note:
call String.RegexSubString("a,b,c", "[^,]+") into Result; // "a" call String.RegexSubString("a,b,c", null) into Result; // null call String.RegexSubString("a,b,c", "[^,]+", 0, 1) into Result; // "b" call String.RegexSubString("a,b,c", "[^,]+", 2, 0) into Result; // "b"
Finds a substring of string that matches the regex pattern.
Note:
call String.RegexCount("a,b,c", "[^,]+") into Result; // 3 call String.RegexCount("a,b,c", "[^,]+", 2) into Result; // 2
Count the occurrences of the regex pattern in the string.
Regular Expression Options
Note:
call String.Tokenize("TASK_SEQ=20267^&TASK_SEQ=20268^", "&") into Result; // List<Text> { "TASK_SEQ=20267^", "TASK_SEQ=20268^" } call String.Tokenize("foo=bar^;test=value^", ";") into Result; // List<Text> { "foo=bar^", "test=value^" } call String.Tokenize("test1^test2^^test3", "^") into Result; // List<Text> { "test1", "test2", "test3" }
Note:
call Convert.ToNumber("505") into Result; // 505 call Convert.ToNumber("505.7") into Result; // 505.7
Converts a value to a number Note: if an incorrect value is passed, the default value of null will be returned
call Convert.ToInteger("505") into Result; // 505 call Convert.ToInteger("505.7") into Result; // 505 call Convert.ToInteger("2015-09-15T07:00:00") into Result; // null call Convert.ToInteger(true) into Result; // 1 call Convert.ToInteger(false) into Result; // 0 Converts a value to an integer
Note: if an incorrect string value is passed, null will be returned
call Convert.ToBoolean("true") into Result; // true call Convert.ToBoolean("True") into Result; // true call Convert.ToBoolean("TRUE") into Result; // true call Convert.ToBoolean("false") into Result; // false call Convert.ToBoolean(0) into Result; // false call Convert.ToBoolean(1) into Result; // true call Convert.ToBoolean("HelloWorld") into Result; // null
Converts a value to a boolean. Note: if an incorrect value is passed, the default value of null will be returned
call Convert.ToTimestamp("2018-06-28T13:01:46") into Result; // Result = 2018/06/28 13:01:46.000000 call Convert.ToTimestamp("2018-06-28T13:01:46.0000000") into Result; // Result = 2018/06/28 13:01:46.000000 call Convert.ToTimestamp("2018/06/28 13:01:46") into Result; // null
Converts a value to a timestamp Note: if an incorrect Timestamp format is passed to this method, the result will be null
call Convert.ToString(NumberVariable) into Result; // Result "505.7" call Convert.ToString(IntegerVariable) into Result; // Result "505" call Convert.ToString(BooleanVariable) into Result; // Result "True" call Convert.ToString(TimestampVariable) into Result; // Result "2018-06-28T13:01:46.0000000"
Converts a value to a string
// variable Keys Structure(FndDocumentKeys); call Attachment.CreateAndConnectDoc("WorkOrder", "WO_NO=3323^", "My Document Title") into Keys;
Creates a new document with Title
and connects it to the specified record by LuName
and KeyRef
. This call will return the keys of the document (DocClass
, DocNo
, DocSheet
and DocRev
) which can later be used in the upload statement of a command.
// variable FileExts Text call Attachment.GetDocFileExtensions() into FileExts;
Returns a comma separated list of file extensions that can be used when attaching files to a document created by CreateAndConnectDoc
.
// variable Keys Structure(FndMediaKeys); call Attachment.CreateAndConnectMedia("WorkOrder", "WO_NO=3323^", "My Media Name") into Keys;
Creates a new media item with Name
and connects it to the specified record by LuName
and KeyRef
. This call will return the keys of the media item (ItemId
) which can later be used in the upload statement of a command.
// variable FileExts Text call Attachment.GetMediaFileExtensions() into FileExts;
Returns a comma separated list of file extensions that can be used when attaching files to a media item created by CreateAndConnectMedia
.
A limited subset of the system calls that can be used in procedures can also be used in where expressions. E.g.: using the current timestamp within a count query or an offline filter:
offlinefilter = [DateTime.Timestamp() < ExpiresAt];
count Reports where [DateTime.Timestamp() < ExpiresAt] into ReportCount;
The following calls can be made in where expressions:
DateTime.Timestamp(): Timestamp DateTime.Date() : Date DateTime.Date(Timestamp ts) : Date DateTime.Time(Timestamp ts) : Time DateTime.AddYears(Timestamp ts, Integer years) : Timestamp DateTime.AddMonths(Timestamp ts, Integer months) : Timestamp DateTime.AddDays(Timestamp ts, Number days) : Timestamp DateTime.AddHours(Timestamp ts, Number hours) : Timestamp DateTime.AddMinutes(Timestamp ts, Number minutes) : Timestamp DateTime.AddSeconds(Timestamp ts, Integer seconds) : Timestamp String.Like(string, pattern) : Boolean