I am working on one customization and we need to set the Ready To Process checkbox true on the Sales Order Entry screen when we received payment from the customer. I have created a Method Directive on CashRec.UpdateMaster and using the below code but system is throwing error “Row Modified by Another User”
Erp.Contracts.SalesOrderSvcContract SOsvc = Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.SalesOrderSvcContract>(Db);
using (var txscope = IceDataContext.CreateDefaultTransactionScope())
{
var OrderDs = SOsvc.GetByID(ttCashHed_Row.OrderNum);
if(OrderDs.OrderHed[0].UDField<bool>("DraftOrder_c"))
{
OrderDs.OrderHed[0].SetUDField<bool>("DraftOrder_c", false);
OrderDs.OrderHed[0].SetUDField<bool>("CheckBox05", true);
OrderDs.OrderHed[0].RowMod = "U";
SOsvc.Update(ref OrderDs);
bool lCheckForOrderChangedMsg = true;
bool lcheckForResponse = true;
string cTableName = "OrderHed";
int iCustNum = OrderDs.OrderHed[0].BTCustNum;
int iOrderNum = OrderDs.OrderHed[0].OrderNum;
bool lweLicensed = false;
bool outbool;
string outstring;
SOsvc.MasterUpdate(lCheckForOrderChangedMsg,lcheckForResponse, cTableName, iCustNum, iOrderNum, lweLicensed, out outbool,out outstring,out outstring,out outstring,out outstring,out outstring,out outstring,out outstring, out outstring, ref OrderDs);
}
txscope.Complete();
}
Anyone can suggest how to resolve this.