Open Form with Job Number from Button

Yes a fellow southerner. Spent most of my life near Knoxville.

I opened up the Issue Material screen and went to field help and found the box I am wanting to populate the field is parttran.jobnum

I then went to customization mode and opened up Object explorer and changed the code to

private void RcptToInvForm_Load(object sender, EventArgs args)
{
	// Add Event Handler Code
	if (RcptToInvForm.LaunchFormOptions != null) 
		{ 
			EpiDataView edv = (EpiDataView)oTrans.EpiDataViews["PartTran"]; 
			edv.dataView[edv.Row]["JobNum"] = RcptToInvForm.LaunchFormOptions.ContextValue.ToString(); 
		} 
}

When I went to Object Explorer and found the parttran dataview and clicked on jobnum the code below is what it showed if that helps.

Dim [edvVarName] As EpiDataView = CType(oTrans.EpiDataViews(“PartTran”), EpiDataView)
Dim [VarName] As String = [edvVarName].dataView([edvVarName].Row)(“PartNum”)

'// ** Or
'// Dim [dvVarName] As DataView = [edvVarName].dataView
'// Dim [VarName] As String = dvVarName(“PartNum”)

I still think you’re barking up the wrong tree. I dont think that you are looking for the PartTran edv.

Use Help -> Field Help then click into the textbox where you enter the job. The epiBinding property should tell you both the edv and fieldname you are looking for.

Okay will look there. I just tried to open and got a “Exception has been thrown by the target of an invocation” error.
Here is pic of what field explorer says

pic

Also here are the Dataviews on the Issue Material screen

pic1

If you have a moment now - join me for a quick 15 min booster

Well played with this code some more and remarked out the last line to see which one was causing it to bomb and found this line is the problem child.

edv.dataView[edv.Row]["JobNum"] = RcptToInvForm.LaunchFormOptions.ContextValue.ToString();

I’d venture to say that row is -1 which means there isnt one. You have to create a new transaction first.

not following. Sorry for my ignorance

click my link above, we’ll do a web session real quick

Made some progress today and at least got the job to populate on all 4 button clicks. I really would like to learn how to pass the assembly and operation as well but too beat tonight to do any more. Thanks for all the help thus far.

1 Like