Print

AddObjectToList()

AddObjectToList() function creates a list of objects of any types (e.g. string, numeric, bool, datetime or even complex object). A variable representing the list has to been initialized before calling this function (see examples below).

Syntax

AddObjectToList(listVariable, objectValue);
AddObjectToList(listVariable, objectVariable);
AddObjectToList(listVariable, objectField);

Function arguments

  • listVariable – (String) a variable used to store the list of objects;
  • objectValue – (Object) a value of an object (which can be string, numeric or bool value);
  • objectVariable – (Object) a variable which contains an object (accepted types of variable: string, numeric, bool, datetime, object and file);
  • objectField – (Object) a field on the case form which contains an object (accepted types of variable: string, numeric, bool, datetime, object and file).

Return value

This function returns Boolean.
This function returns true if object was successfully added into the list. Otherwise it returns false.

Examples

Example 1

It creates two variables: 'myList’ to store a list of objects and 'myComplexObject’ which contains some complex object with two properties (fields): 'myfield1′ and 'myfield2′. Then, the function is executed five times which means that five elements (objects) are added into the list. First three executions show how values kept explicitly in code can be added as objects to the list. Fourth execution introduces the way how the complex object can be defined and added as a next object into the list. The last execution describes the scenario when value contained inside the specific field on the case (field called 'myField’) can be added as a object into the list (assuming that type of the field is: text, numeric, bool, datetime or file).

myList = "";
myComplexObject.myfield1 = "";
myComplexObject.myfield2 = 3.14;
AddObjectToList(myList, "ABC");
AddObjectToList(myList, 123.0);
AddObjectToList(myList, true);
AddObjectToList(myList, myComplexObject);
AddObjectToList(myList, [myField]);

 

Czy artykuł był pomocny?
0 na 5 gwiazdek
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
5
How can we improve this article?
How Can We Improve This Article?