29.03.2022, 09:30
|
#20
|
Участник
Регистрация: 03.12.2019
Адрес: Россия
|
Таблица: zRecordInfoTmp
Метод: zRecordInfoTmp
X++: static zRecordInfoTmp fillForRecord(Common record, zRecordInfoTmp _zRecordInfoTmp = null, str _dsName = "", int _dsNum = 0, int _repeatCount = 1)
{
zRecordInfoTmp zRecordInfoTmp;
DictTable dictTable;
DictField dictField;
int fieldCnt;
int i;
int j;
int arraySize;
str ts;
;
if (_zRecordInfoTmp)
zRecordInfoTmp = _zRecordInfoTmp;
dictTable = new DictTable(record.TableId);
fieldCnt = dictTable.fieldCnt();
for (i = 1; i <= fieldCnt; i++)
{
dictField = dictTable.fieldObject(dictTable.fieldCnt2Id(i));
arraySize = dictField.arraySize();
for (j = 1; j <= arraySize; j++)
{
if (dictField.isSql())
{
//w(dictField.);
zRecordInfoTmp.clear();
zRecordInfoTmp.FormDatasourceNum = _dsNum;
zRecordInfoTmp.FormDatasourceName = _dsName;
zRecordInfoTmp.RefRecId = record.RecId;
zRecordInfoTmp.TableName = dictTable.name();
if (_dsName && _repeatCount > 1)
zRecordInfoTmp.TableName += strfmt(" [%1]", _dsName);
zRecordInfoTmp.RefTableId = dictTable.id();
zRecordInfoTmp.RefFieldName = dictField.name(DbBackEnd::Native, j) + (arraySize > 1 ? strFmt('[%1]', j) : "");
zRecordInfoTmp.RefFieldId = dictField.id();
zRecordInfoTmp.FieldArrayIdx = j;
zRecordInfoTmp.FieldLabel = dictField.label(j);
if (dictField.type() == Types::Time)
{
zRecordInfoTmp.FieldValue = time2str(record.(fieldid2ext(dictField.id(), j)), 1, 1);
}
else if (dictField.type() != Types::Container
&& dictField.baseType() != Types::Container // <------ fix
)
{
ts = strfmt("%1", dictField.type());
zRecordInfoTmp.FieldValue = strfmt("%1", record.(fieldid2ext(dictField.id(), j)));
}
else
{
zRecordInfoTmp.FieldValue = "[Container]";
}
zRecordInfoTmp.insert();
}
}
}
return zRecordInfoTmp;
}
Если имеется таблица у которой поле является EDT который в свою очередь является производным от Extends который в свою очередь с типом Container. Тогда вылетает ошибка.
Последний раз редактировалось oleggy; 29.03.2022 в 09:34.
|
|
За это сообщение автора поблагодарили: S.Kuskov (2). |