Share via


EventCreateRule.fieldsAreInUniqueIndex Method [AX 2012]

Determines whether the fieldIds that are in the specified set are unique key fields for the specified table.

Syntax

public boolean fieldsAreInUniqueIndex(TableId _tableId, Set _fields)

Run On

Called

Parameters

  • _fields
    Type: Set Class
    The set that contains the fieldIds that are to be tested against unique indexes of the table.

Return Value

Type: boolean
true if the fields in the set are a unique identifier for the table; otherwise, false.

Remarks

For each unique index in the table, compare the components (fields) of that index to the fields in the set. If all the fields in the index are found in the set, the method returns true.

Examples

void MyMethod() 
{ 
    Set s = new Set(Types::Integer); 
    EventCreateRule EventCreateRule; 
 
    s.add(FieldNum(SalesTable,SalesId)); 
    if (EventCreateRule.fieldsAreInUniqueIndex(tableNum(SalesTable), s)) 
    { 
        // Yes, field SalesId is unique identifier for records in SalesTable 
    } 
}

See Also

Reference

EventCreateRule Class