We created a data directive that would amend an order, using the SalesOrderSvcContract. Now it was quite complex and started giving a transaction aborted error. So reduced the code to the simplest that I could that still gave the error, which is below, anyone else have this issue and worked out a solution?
using (Erp.Contracts.SalesOrderSvcContract soSvc = Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.SalesOrderSvcContract>(Db))
{
int orderNum = 1008400;
try
{
var salesOrderTS = new Erp.Tablesets.SalesOrderTableset();
salesOrderTS = soSvc.GetByID(orderNum);
var ttOrderHedR = salesOrderTS.OrderHed.FirstOrDefault(x => x.Company.Equals(Session.CompanyID));
ttOrderHedR["OrderType_c"] = "";
ttOrderHedR.RowMod = "U";
soSvc.Update(ref salesOrderTS);
}
catch (Exception ex)
{
this.PublishInfoMessage("Error : " + ex.Message, Ice.Common.BusinessObjectMessageType.Information, Ice.Bpm.InfoMessageDisplayMode.Individual, "", "");
}
}