Help on Displaying PartAdapter info in Order Entry

I am trying to set up a lookup to display some useful information on the order entry screen, specifically on the lines tab. I want to show a check box to show whether a part number is qty bearing or not. I have the PartAdapter working, except I am not using the data set correctly. I currently am trying to hang the lookup on on an dataview notification, but this fires multiple times when loading, I’m sure because the data view has more than one row, but I have only one checkbox to assign it to.

Is anyone willing to give me some pointers for how I can know which row is selected?

Thanks.

		if (args.NotifyType == EpiTransaction.NotifyType.Initialize)
		{
			try
			{
			var PartNum = edvOrderDtl.dataView[edvOrderDtl.Row]["PartNum"].ToString();
			PartAdapter pa = new PartAdapter(oTrans);
			pa.BOConnect();
			pa.GetByID(PartNum);
			if (pa.PartData.Part[0].QtyBearing = true)
				{
				QtyBearing.Checked = true;
				MessageBox.Show("this is a qty bearing part");
				}
				{
				QtyBearing.Checked = false;
				MessageBox.Show("This is NOT a qty bearing part");
				}
				//QtyBearing = pa.PartData.Part[0].QtyBearing.Value;
				pa.Dispose();
			}
			catch
			{
			}
		}

I recommend you use a ForeignKeyView FKV it requires no code and it is much more efficient.
Now if you want to do the adapter for adapter sake (learning) that’s a different story.

image


Then part will show up as an EpiDataView in the form and automatically lookup when the line changes.

1 Like

That’s a good idea. I haven’t been able to get FKV’s to work before, this will be a perfect opportunity to learn it.

Quick question on FKV. The the view name that you type in whatever you want? Or is it something that has to match something. (Customization has some freetext fields that need to match exactly). A quick test seems to indicate it’s a “whatever I want” name, but I just wanted to be sure.

image

Whatever you want

1 Like