Display PartRev Field on Job Entry Form

Hi,
I am trying to add a UD Field from the PartRev table onto the JobEntry form.
I was able to add a field from the Part table, using FKV, however, this doesn’t seem to work with the PartRev table.

Any ideas?

FKV won’t work on PartRev since PartRev has multiple key fields (PartNum, Revision, AltMethod). Best option for this kind of situation is a BAQ view. That is, you create a BAQ with all of the needed info, and then subscribe it to one of the existing EpiDataViews.

Since this is a super common requirement, I usually plug this method into my form

public void CreateChildBaqView(string BaqId, string ViewName, string ParentView,
								string[] ParentCols, string[] ChildCols)
	{
		BAQDataView baqView = new BAQDataView(BaqId);
		oTrans.Add(ViewName, baqView);
		EpiDataView parent = (EpiDataView)oTrans.EpiDataViews[ParentView];
		baqView.SetParentView(parent, ParentCols, ChildCols);
	}

Then I initialize each BaqView in InitializeCustomCode like so:

public void InitializeCustomCode()
{		
	CreateChildBaqView("Form_PartLot_MaterialHistory", "MaterialHistory", "JobHeadList",
		new string[] { "Company", "JobNum" }, //List of parent fields
		new string[] { "Calculated_Company", "Calculated_BaseJob" }); //List of corresponding BAQ cols
}

This will add your BAQ as another EpiDataView in your form. So you can bind controls (including grids) to it and it will update whenever the subscribed parent fields change. Note that this will also filter you BAQ results by the key columns. It’s quite efficient. I’ve got four BAQViews on JobEntry as of this writing. You don’t need to pass parameters to the BAQ. Pretty sure parameters will break this.

FYI: This specific example powers a grid in Job Tracker that displays a complete history of material issued to not just the job in question, but any jobs that went into child assemblies.

Thank you, I haven’t done any EpiDataViews yet – new thing to learn :+1: