I am trying to auto end all activities in the production tab of MES. I remember doing this before but having this same issue and can’t remember how to resolve it. here is my code. I get the error that the labordtl record has not changed then when it hits the change before the update I get can’t change an active transaction. Any help would be greatly appreciated.
foreach(Infragistics.Win.UltraWinGrid.UltraGridRow UGR in ProdGV.Rows)
{
ProdGV.ActiveRow = UGR;
LaborAdapter Ladap = new LaborAdapter(this.MESMenu);
Ladap.BOConnect();
int iLaborHedSeq;
int.TryParse(UGR.Cells[2].Text,out iLaborHedSeq);
int iLaborDtlSeq;
int.TryParse(UGR.Cells[3].Text,out iLaborDtlSeq);
//int iLaborDtlSeq = UGR.Cells[3].Value;
Boolean GDTL = Ladap.GetDetail(iLaborHedSeq, iLaborDtlSeq);
Boolean EAWorked = Ladap.EndActivity();
string msg;
Boolean setqty = Ladap.DefaultLaborQty(1,out msg);
Ladap.LaborData.LaborDtl[0]["LaborQty"] = 1;
Ladap.Update();
Ladap.Dispose();
}