Load a DataSet in a Form

Hello, I feel silly asking, but I can’t seem to figure out how to load a dataset in the Part Maint screen. Rather than using oTrans.Refresh() methods or anything like that I need to query/find a dataset and then load it in the screen.

Erp.Proxy.BO.PartImpl PNumAdapter = WCFServiceSupport.CreateImpl<Erp.Proxy.BO.PartImpl>((Ice.Core.Session)oTrans.Session, Epicor.ServiceModel.Channels.ImplBase<Erp.Contracts.PartSvcContract>.UriPath);
Erp.BO.PartDataSet PartDS = new Erp.BO.PartDataSet();
PartDS = PNumAdapter.GetByID(vPartNum)

My code above gets the DS just fine, but how do I load it in PartMaint? I’m nervous I’ll look dumb by the end of this, but hey we don’t know it all right? :slight_smile: Thank you.

What type of control are you wanting to load this data into?

Why not just call oTrans.PartChanged(“newPartNum”);

Thank you for the responses. I’m simply trying to load the DataSet in the PartMaint UI. I tried oTrans.PartChanged(vPartNum); but unfortunately, it looks like it doesn’t recognize the method:

‘Erp.UI.App.PartEntry.PartTransaction’ does not contain a definition for ‘PartChanged’ and no extension method ‘PartChanged’ accepting a first argument of type ‘Erp.UI.App.PartEntry.PartTransaction’ could be found (are you missing a using directive or an assembly reference?)

Hello,

Is there a way to use the DataSet to populate the EpiDataViews? I know doing this is all atypical, but I have to do it this way because I am passing a PartNum string back to Part Maint from a subscreen. I can pass the string just fine, but loading it in the screen has been a nightmare.

What version?

It’s for 10.1. Any ideas/help is much appreciated.

PartChanged is there in oTrans just invoke it via reflection it is private. Or better yet, do what Epicor does
Populate the partNumber into the partTextBox and then call

oTrans.ValidateField(tbPartNum)

2 Likes

oTrans.GetByID(partnum) ??

Thank you so much Jose! This was the fix. To anyone else who may need this in the future, you have to set the .Text property; the .Value property didn’t work for me for some reason.

else	{
			txtbxPartNum.Text = vPartNum;
			oTrans.ValidateKeyField(txtbxPartNum);
		}

You would think! I tried this.oTrans_adapter.GetByID(vPartNum) but for some reason it would not work. I have to say, this one was a special need and your code would likely work the vast majority of the time, but in my case I am passing values back and forth between screens so the events (for some reason) don’t seem to be behaving as they would normally.

1 Like