![]() |
#12 |
Ищущий знания...
|
может кому пригодиться
![]() 1. В классе SysDictTable метод find(): X++: static Common find(TableId _tableId, RefRecId _recId, boolean _forUpdate = false) { Common common; DictTable dictTable; ; if (_recId != 0) { dictTable = new DictTable(_tableId); common = dictTable.makeRecord(); common.selectForUpdate(_forUpdate); select firstOnly common where common.RecId == _recId; } return common; } X++: static void testFindCommon(Args _args) { InventTable inventTable; Common common; ; select firstonly inventTable; // без forUpdate --> common = SysDictTable::find(inventTable.TableId, inventTable.RecId); info(strFmt('До update - %1', common.(fieldNum(InventTable, ItemId)))); // без forUpdate <-- // с forUpdate --> ttsbegin; common = SysDictTable::find(inventTable.TableId, inventTable.RecId, true); common.(fieldNum(InventTable, ItemId)) = common.(fieldNum(InventTable, ItemId)) + 'Тест'; common.doUpdate(); ttscommit; info(strFmt('После update - %1', common.(fieldNum(InventTable, ItemId)))); // с forUpdate <-- }
__________________
"Страх перед возможностью ошибки не должен отвращать нас от поисков истины." (с) С Уважением, Елизаров Артем |
|
|
За это сообщение автора поблагодарили: 3oppo (1), propeller (1). |