I just wanted to share this and see if anyone sees any foreseeable issues with doing it this way.
We have an assy which uses a phantom part - as such it requires op10 to create the phantom part, and op20 to create the top level (using the phantom). We don’t want our users to have to manually run both ops each time so I automated it.
void Submit()
{
// get the data before it changes
EpiDataView ld = oTrans.Factory("LaborDtl");
var MyCopy = ld.dataView.Table.Rows[ld.Row];
//initial submission
TimeExpenseForm.GetType().InvokeMember("btnSubmit_Click",BindingFlags.InvokeMethod | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic,null,TimeExpenseForm, new object[]{null, null});
if(multipleassy) //if we have second op to autosubmit.....
{
oTrans.PushStatusText("Please wait... Auto submitting 2nd op",true);
newdtlBTN.PerformClick(); //creates new LaborDtl
var newRow = ld.dataView[ld.Row];
newRow.BeginEdit(); //now we copy relevant info, but change the op
newRow["JobNum"] = MyCopy["JobNum"];
newRow["LaborQty"] = MyCopy["LaborQty"];
newRow["OprSeq"] = 20;
newRow.EndEdit();
TimeExpenseForm.GetType().InvokeMember("btnSubmit_Click",BindingFlags.InvokeMethod | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic,null,TimeExpenseForm, new object[]{null, null});
multipleassy = false;
oTrans.PushStatusText("Ready.",false);
}
//MessageBox.Show("Reflected Submission");
}