Array.typeId Method [AX 2012]

Returns the data type of the values in the array.

public Types typeId()

Run On

Called

Return Value

Type: Types Enumeration
The data type of the elements in the array.

The type remains the same throughout the life of the array. The type is specified when the array is created.

The following example tests whether a particular array element exists. If it does not exist, the typeId method is used to specify the type of the new value that should be added to the array.

public anytype getArrayValue(Array a, int _index) 
{ 
    if (! a.exists(_index)) 
    { 
        a.value(_index,nullValueFromType(a.typeId())); 
    } 
  
    return a.value(_index); 
}

Community Additions

ADD
Show: