DictTable.relation Method [AX 2012]

Returns the name of a relation that is specified by index.

public str relation(int RelationNumber, [TableScope tableScope])

Run On

Called

Parameters

RelationNumber
Type: int
The one-based index to the list of relations for the table, in AOT order.
tableScope
Type: TableScope Enumeration

Return Value

Type: str
The name of the relation that is specified by the RelationNumber parameter; an empty string if the RelationNumber value is not a valid relation index.

The following example shows the retrieval of the name for each relation in a table.

DictTable dt; 
int       i; 
 
dt = new DictTable(tablenum(CustTable)); 
if (dt) 
{ 
    for (i=1; i <= dt.relationCnt() ; i++) 
    { 
        print dt.relation(i); 
    } 
}

Community Additions

ADD
Show: