Инициализация всех полей
Запись от Link размещена 19.11.2014 в 14:15
X++:
static void initAllFields(Common _fromTable, Common _toTable, boolean _skipRefRecId = true) { DictTable dictTable; DictField dictField; DictType dictType; int i; FieldId fieldId; dictTable = new DictTable(_toTable.TableId); if (dictTable) { for (i = 1; i <= dictTable.fieldCnt(); i++) { fieldId = dictTable.fieldCnt2Id(i); dictField = new DictField(_toTable.TableId, dictTable.fieldCnt2Id(i)); // Excluding system fields if (dictField && !dictField.isSystem()) { dictType = new SysDictType(dictField.typeId()); // Excluding RefRecId fields by default if ( _skipRefRecId && ( dictType.name() == extendedTypeStr(RefRecId) || dictType.isExtendedFrom(extendedTypeStr(RefRecId)))) { continue; } _toTable.(fieldId) = _fromTable.(fieldId); } } } }
Всего комментариев 1
Комментарии
-
V.2
X++:static void initAllFields(Common _fromTable, Common _toTable, boolean _skipRefRecId = false) { DictTable dictTable; int i; SysDictField sysDictField; dictTable = new DictTable(_toTable.TableId); if (dictTable) { for (i = 1; i <= dictTable.fieldCnt(); i++) { sysDictField = new SysDictField(dictTable.id(), dictTable.fieldCnt2Id(i)); // Excluding system fields if ( sysDictField && !sysDictField.isSystem()) { // Excluding RefRecId fields by default if ( _skipRefRecId && sysDictField.isDerivedFrom(extendedTypeNum(RefRecId))) { continue; } _toTable.(sysDictField.id()) = _fromTable.(sysDictField.id()); } } } }
Запись от Link размещена 19.11.2014 в 15:30