Показать сообщение отдельно
Старый 18.04.2006, 11:12   #1  
murad is offline
murad
Участник
 
55 / 10 (1) +
Регистрация: 05.10.2005
? проблема SelectForUpdate
Необходимо просто обновить запись
Пишу на C#:

Код:
...
while ((bool)oQueryRun.Call("Next",Type.Missing,Type.Missing,Type.Missing,Type.Missing,Type.Missing,Type.Missing))
				{
					IAxaptaRecord rec = (IAxaptaRecord)oQueryRun.Call("GetNo", 1,Type.Missing,Type.Missing,Type.Missing,Type.Missing,Type.Missing);																
					if(i==2)
					{
						ax.TTSBegin();
						object o=rec.Call("SelectForUpdate",true,Type.Missing,Type.Missing,Type.Missing,Type.Missing,Type.Missing);
						rec.set_field("SalesName","SOMEVALUE");						
						rec.DoUpdate();
						ax.TTSCommit();
					}
}
Выскакивает exception:
About to update a record in table 'SalesTable' which was not selected for update (RecId is 36538235). [W-0108]
Cannot edit a record in Sales orders (SalesTable).
The operation cannot be completed, since the record was not selected for update. Remember TTSBEGIN/TTSCOMMIT as well as the FORUPDATE clause.
(S) \Classes\xRecord\DoUpdate

По видимому, selectforupdate делается иначе. Подскажите как?