Skip to content

System Methods

Call Methods

System

System.LogLocation()

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.

System.CreateGuid()

call System.CreateGuid() into MyGuid;  

Generates and returns a new GUID that contains 32 alphanumeric characters. For example, 86DFA50C48F64A30918D76DC81B16E97.

System.GetParameter()

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 the IFS Cloud Web.

Lists

List.Add(List list, T item);

// variable Steps List<Structure(SurveyStep)>;  
// variable Item Structure(SurveyStep);  
call List.Add(Steps, Item);  

Adds an item to a list variable.

List.Remove(List list, T item);

// variable Steps List<Structure(SurveyStep)>;  
// variable Item Structure(SurveyStep);  
call List.Remove(Steps, Item);  

Removes an item from a list variable.

List.Clear(List list);

// variable Steps List<Structure(SurveyStep)>;  
call List.Add(Steps);  

Removes all items from a list variable.

List.Count(List list): Integer;

// variable Steps List<Structure(SurveyStep)>;  
// variable ListCount Integer;  
call List.Count(Steps) into ListCount;  

Adds an item to a list variable.

List.Get(List list, Integer index): T;

// 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.

List.IndexOf(List list, T item): Integer;

// 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.

Dates and Times

DateTime.Timestamp(): Timestamp

call DateTime.Timestamp() into Result;  

Gets the current timestamp.

DateTime.Timestamp( Integer year, Integer month, Integer day, Integer hours, Integer mins, Integer secs): Timestamp

call DateTime.Timestamp(2018, 4, 18, 12, 10, 0) into Result;  

Creates a timestamp from the supplied parameters.

DateTime.Date(): Date

call DateTime.Date() into Result;  

Gets the current date.

DateTime.Date(Timestamp ts): Date

call DateTime.Date(Attrib) into Result;  

Returns the timestamp with the time portion set to 00:00:00.

DateTime.Date(Integer year, Integer month, Integer day): Date

call DateTime.Date(2018, 4, 18) into Result;  

Creates a date from the supplied parameters.

DateTime.Time(Timestamp ts): Time

call DateTime.Time(Attrib) into Result;  

Returns the time from a timestamp.

DateTime.Time(Integer hours, Integer mins, Integer secs): Time

call DateTime.Time(12, 10, 0) into Result;  

Creates a time from the supplied parameters.

DateTime.AddYears(Timestamp ts, Integer years): Timestamp

call DateTime.AddYears(Attrib, 2) into Result;  

Adds years to the supplied timestamp.

DateTime.AddMonths(Timestamp ts, Integer months): Timestamp

call DateTime.AddMonths(Attrib, 3) into Result;  

Adds months to the supplied timestamp.

DateTime.AddDays(Timestamp ts, Number days): 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.

DateTime.AddHours(Timestamp ts, Number hours): Timestamp

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.

DateTime.AddMinutes(Timestamp ts, Number minutes): Timestamp

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.

DateTime.AddSeconds(Timestamp ts, Integer seconds): Timestamp

call DateTime.AddMinutes(Attrib, 30) into Result;  

Adds seconds to the supplied timestamp.

DateTime.DifferenceInDays(Timestamp a, Timestamp a): Number

call DateTime.DifferenceInDays(AttribA, AttribB) into Result;  

Calculated the difference between two timestamps in days as a fractional number.

DateTime.DifferenceInHours(Timestamp a, Timestamp a): Number

call DateTime.DifferenceInHours(AttribA, AttribB) into Result;  

Calculated the difference between two timestamps in hours as a fractional number.

DateTime.ToFormattedString(Timestamp input, Text format): Text

call DateTime.ToFormattedString(TimestampVar, "dd/mm/yyyy hh:mm") into Result;

Converts a given timestamp to a string using the .NET formatting options.

DateTime.ToOracleFormat(Timestamp input, Text format): Text

call DateTime.ToOracleFormat(TimestampVar, "DD-MON-YYYY HH24:MI:SS") into Result;

Converts a given timestamp to a string using the Oracle TO_CHAR formatting options.

Time Zone

call DateTime.TimestampUtc() into Record.RegisterDate;

Converts a given timestamp to be time zone aware timestamp.

String

String.Length(string): Number

call String.Length("abcde") into Result; // "5"  

Returns the length of a string

String.Trim(string): Text

String.Trim(string, char): Text

String.TrimStart(string): Text

String.TrimStart(string, char): Text

String.TrimEnd(string): Text

String.TrimEnd(string, char): Text

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.

String.ToUpper(string): Text

call String.ToUpper("MyValue") into Result; // "MYVALUE"  

Converts a string to upper case

String.ToLower(string): Text

call String.ToLower("MyValue") into Result; // "myvalue"  

Converts a string to lower case

String.Like(string, pattern): Boolean

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

String.Replace(string, searchString, replacementString): Text

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

String.SubStringLength(string, startPosition, endPosition): Text

Call String.SubStringLength("HelloWorld", 1, 3) into Result; // "Hel"
Returns the substring within of a given string within the speicifed starting position and ending position.

String.RegexLike(string, pattern): Boolean

String.RegexLike(string, pattern, options): Boolean

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.

String.RegexReplace(string, pattern, replacementString): Text

String.RegexReplace(string, pattern, replacementString, options): Text

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:

  • If the pattern is null or empty, the original string is returned
  • If the replacementString is null or empty, the characters in the regexPattern are removed.

String.RegexSubS