i am doing Epicor customization , i tried to create new row in labor detail table , but it came out this error

LaborAdapter adapterLabor = new LaborAdapter(this.oTrans);
adapterLabor.BOConnect();
//adapterLabor.GetNewLaborDtl(1109);
bool resultGetNewLaborDtl = adapterLabor.GetNewLaborDtlAttch(1111,217588);;
System.Windows.Forms.MessageBox.Show(resultGetNewLaborDtl.ToString(), "Done");
Method call
.GetNewLaborDtlAttch(1111,217588)is attempting to add a record for LaborHedSeq1111and LaborDtlSeq217588which has already been previously saved to the database and cannot be a duplicate in the current session company.Based on your note that you are trying to create a new labor detail record, here are some additional issues to point out that should help on your way:
LaborDtlAttchis not the same asLaborDtland can be used when aLaborDtlalready exists.LaborAdapteris anIDisposable. It is important to wrap this in a using or implement a finally/dispose paradigm to prevent memory leaks.Update()method is called.Here is an updated sample of code to get started in creating a new laborDtl record.