Hi everyone,
I want to update two fields in Purchline and when I debbugting the code i go in UPDATE method but it doesn't execute to the end and ExecuteByLine go to catch and nothing happnes.
public void ExecuteByLine()
{
try
{
while select firstOnly forUpdate _purchLine
where _purchLine.dataAreaId == _areaId
&& _purchLine.PurchId == _purchId
&& _purchLine.InventTransId == inventTransId
{
_purchLine.InterCompanyOrigin = 0;
_purchLine.InterCompanyInventTransId = "";
_purchLine.update();
}
}
catch
{
error(strFmt("Error! The operation is unsuccessful!"));
}
}
When I try to update PurchTable , the ExecuteByHeader doesn't go to catch mathed and everything looks fine but when I check what happened in SQL . The result is nothing.
public void ExecuteByHeader()
{
try
{
while select forUpdate _purchTable
where _purchTable.dataAreaId == _areaId
&& _purchTable.PurchId == _purchId
{
ttsBegin;
_purchLine.clear();
_purchTable.InterCompanyOrigin = 0;
_purchTable.InterCompanyCompanyId = "";
_purchTable.InterCompanySalesId = "";
_purchTable.InterCompanyOrder = 0;
_purchTable.update();
ttsCommit;
}
}
catch
{
error(strFmt("Error! The operation is unsuccessful!"));
}
}
Sometimes in debug mode throws this error:

*This post is locked for comments
I have the same question (0)