![]() |
#5 |
Участник
|
Вот набрасал пример джоба, который заполняет таблицу (можно и темповую, неважно), в таблице есть метод, который пишет данные в неё по полученной записи,
единственно нужно добавить анализ по полям типа modifiedBY,TableId и т.п., а так все работает : X++: static void TestJob(Args _args) { TmpTest tmpTest; InventTable inventTable; ; while select * from inventTable { tmpTest.setTmpData(tmpTest.makeRecord("InventTable","TmpTest" ,inventTable,tmpTest)); if (tmpTest.RecId != 0) tmpTest.insert(); } while select * from tmpTest { info(tmpTest.ItemId + tmpTest.ItemName); } } X++: Common makeRecord(str _fromTable, str _toTable, Common _fromCommon, Common _toCommon) { DictTable dictTable1 = new DictTable(tablename2Id(_toTable)); DictTable dictTable2 = new DictTable(tablename2Id(_fromTable)); int i; int t2FieldId; str t1FieldId; ; for (i = 1;i <= dictTable2.fieldCnt();i++) { t1FieldId = dictTable2.fieldName(dictTable2.fieldCnt2Id(i)); if (!dictTable1.fieldName2Id(t1FieldId)) continue; t2FieldId = dictTable2.fieldCnt2Id(i); _toCommon. (dictTable1.fieldName2Id(t1FieldId)) = _fromCommon. (t2FieldId); } if (_toCommon.RecId != 0) return _toCommon;//.insert(); else return null; } |
|