Autosubmit second operation

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");
}

When we use phantom boms, we just add the operation as backflush. Then you set up your backflush processing and it will complete the operation automatically.

Set this up on a schedule (don’t use the settings shown, I just took a screen shot to show you the screen), we have ours run every 2 minutes, which is probably overkill.
image

Get the hell outta here, it’s that easy? Bahaha. Well, I guess as long as one is still learning, one is still useful. :stuck_out_tongue_winking_eye: Thanks @Banderson

What else does that Process Labor do? It only affects backflush labor items right?

I don’t know why you haven’t just made your own ERP system from scratch yet, you’d probably do less work. Haha.

1 Like

Yes, as far as I know. We haven’t seen it mess with anything else here. Been running it like that for over a year now.

Lol right?! I actually did create an ERP-type system for my previous company. It wasn’t as broad or as fancy as Epicor but it did do the basics - customers, products, serials, work logs, etc

If I spent as much time reading the manuals as I do looking at decompiled dll’s I might learn something :smile: