List.elements Method [AX 2012]

Specifies the number of elements in a list.

public int elements()

Run On

Called

Return Value

Type: int
The number of elements in the list.

The following example creates a list of integers and adds some elements to it. The elements method is used to test whether there are three elements in the list.

{ 
    List il = new List(Types::Integer); 
 
    il.addStart(1); 
    il.addStart(2); 
    il.addStart(3); 
    if (il.elements() != 3) 
    { 
        print "Something is wrong..."; 
    } 
}

Community Additions

ADD
Show: