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
- _tableId
Type: TableId Extended Data Type
The tableId that is being tested.
- _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
}
}