X++:
static void findAllIndexesWithRecId(Args _args)
{
Dictionary dict = new Dictionary();
DictTable dictTable;
DictIndex dictIndex;
int tableCount;
int indexCount;
int fieldCount;
FieldId fieldId;
FieldId recIdFieldId;
#define.RecId('RecId')
;
for (tableCount=1;tableCount<=dict.tableCnt();tableCount++)
{
dictTable = new DictTable(dict.tableCnt2Id(tableCount));
if (!dictTable.isMap() &&
!dictTable.isSystemTable() &&
!dictTable.isTmp() &&
!dictTable.isView())
{
recIdFieldId = new DictField(dictTable.id(), fieldName2id(dictTable.id(), #RecId)).id();
for(indexCount=0;indexCount < dictTable.indexCnt();indexCount++)
{
dictIndex = new DictIndex(dict.tableCnt2Id(tableCount), dictTable.indexNext(indexCount));
for (fieldCount=0; fieldCount<= dictIndex.numberOfFields();fieldCount++)
{
fieldId = dictIndex.field(fieldCount);
if ((fieldId == recIdFieldId) && strFmt('%1', dictIndex.name()) != #RecId)
{
info (dictTable.name() + ' - ' + dictIndex.name() + ' - ' + strFmt('%1', dictIndex.allowDuplicates()));
}
}
}
}
}
}
Почти все уникальные, но есть и неуникальные.Я думаю особого совсем уж глубокого смысла во всем этом нет.