...
KeyRef := RecRef.KEYINDEX(1);
IF KeyRef.FIELDCOUNT >= ARRAYLEN(KeyArr) THEN // reserve the last index as 'stop code'
ERROR(Text013,SQLMgt.GetTableNameSQL(TableID));
// Delete the following lines.
FOR i := 1 TO KeyRef.FIELDCOUNT DO BEGIN
FieldRef := KeyRef.FIELDINDEX(i);
KeyArr[i,1] := SQLMgt.StringConvert(FieldRef.NAME);
KeyArr[i,2] := FORMAT(FieldRef.TYPE);
END;
// End of the deleted lines.
RecRef.CLOSE;
END;
...
...
KeyRef := RecRef.KEYINDEX(1);
IF KeyRef.FIELDCOUNT >= ARRAYLEN(KeyArr) THEN // reserve the last index as 'stop code'
ERROR(Text013,SQLMgt.GetTableNameSQL(TableID));
// Add the following lines.
IF TableID = DATABASE::"Document Dimension Archive" THEN
GetDocDimArchiveTableKeyFieldArray(KeyRef,FieldRef,KeyArr)
ELSE
FOR i := 1 TO KeyRef.FIELDCOUNT DO BEGIN
FieldRef := KeyRef.FIELDINDEX(i);
KeyArr[i,1] := SQLMgt.StringConvert(FieldRef.NAME);
KeyArr[i,2] := FORMAT(FieldRef.TYPE);
END;
// End of the added lines.
RecRef.CLOSE;
END;
...