MES Automation Blank Title 133654


I do have a working code that starts and end MES productivity. Should I have my code clock in and clock out the employee for every start and stop or should I just clock in the employee initially and clock out when am done with mulitple start's and stops?

 Using Visual Studio, I have scripted the trace from the Start Production Activity and End Production Activity.

 

All seems well but the only issue I have is on the last update, I get the error below:

 

Invalid to modify a transaction that has been Submitted for Approval.

 

 

Does anynone know what this means.

i hope your trying to clock out the employee when End Production Activity is called.

the error mean, your trying to clock out the employee who already clocked in. goto ladordtl table, query by employeeid and you will see number of rows with clock in data and no clock out data. therefore, count number of rows which do not have clockout data (say 5 rows), goto mes and clockout the employee (5times) . now start and end prod activity. 

I hope this helps you !


I was in the wrong row. My previous where clause was incorrect. Had to change it to below and it was golden.

 

  string lbrDtlWhereClause = "JobNum ='" + txtJobNum.Text + "' and OprSeq = " + txtOpSeq.Text + " and ActiveTrans = yes";

                    lDS = lbr.GetRows("EmployeeNum = 'StartEnd' and ActiveTrans = yes BY PayrollDate", lbrDtlWhereClause , "", "", "", "", "", "", "", "", "", "", 0, 0, out morePages);

                    int LaborDtlSeq = int.Parse(lDS.LaborDtl.Rows[0]["LaborDtlSeq"].ToString()); 
                    decimal lbrQty = 1;

                    empB.GetList("EmpID = 'StartEnd' BY Name", 0, 0, out morePages);

                    lDS.LaborDtl.Rows[0].BeginEdit();
                    lDS.LaborDtl.Rows[0]["ApprovalRequired"] = false;
                    lDS.LaborDtl.Rows[0]["ApprovedDate"] = System.DateTime.Now.ToShortDateString();
                    lDS.LaborDtl.Rows[0]["TimeStatus"] = "A";
                    lDS.LaborDtl.Rows[0]["TreeNodeImageName"] = "Approved";
                    lDS.LaborDtl.Rows[0]["RowMod"] = "U";
                    lDS.LaborDtl.Rows[0].EndEdit();