What adapter do I need? / How do find out which adapters to bring in?

Specifically, I’m trying to use LotSelectUpdateDataSet and am getting the

“The type or namespace name ‘LotSelectUpdateDataSet’ could not be found”

message. I run into this occasionally, where there is no clear adapter to bring in to use this. I assumed it was part of LotSelectUpdate.dll but it is not resolving after adding it to the assembly. How do I go about finding out the adapter needed in the future?

image

Try dropping the “set”, is it supposed to be just “LotSelectUpdateData”?

Unfortunately, that is not it either.

aLSUA = new LotSelectUpdateAdapter(this.oTrans);
aLSUA.BOConnect();
aLSUA.GetNewPartLot(partNb.Value.ToString());
		
		
LotSelectUpdateDataSet LSUDS = aLSUA.LotSelectUpdateDataSet;
LotSelectUpdateDataSet.PartLotRow plrow = (LotSelectUpdateDataSet.PartLotRow)LSUDS.PartLot[0];

I’m trying to implement something similar to what is shown in this post

Edit - for clarity, I did try with and without the “Set” attached to the declaration.

Did you reference the assembly in your usings?

I was under the assumption that it pulled them in automatically when you add the custom adapters? extern alias Erp_Adapters_LotSelectUpdate;

image

When I tried adding using Erp.Adapters.LotSelectUpdate; it gives a does not exist in Erp.Adapters message. Sorry for struggling with such a simple concept, I have such a hard time figuring out where all of these adapters and BO’s are coming from.

not sure you need the extern alias references, that’s usually a result of an uplift…

let’s back up a second. did you add the reference via the form wizard or manually?
If manually, it does look like you added both the reference to the Erp.Adapters.LotSelectUpdate and Erp.Contracts.BO.LotSelectUpdate assemblies, which is good.
If you remove the other references in the using statement, including the ones to the LotSelectUpdate ones, and comment out your code where it references, I assume it compiles?

Sometimes you need to save the form in a working state, reload it and then add in your references by uncommenting one thing at a time. I’ve had to do that before many times, especially after adding references

Okay, I did what you suggested and removed the references. (I’m using the Tools->Assembly Reference Manager). I commented out the lines of code using them, and it compiled. I saved, exited. Restarted and immediately loaded the customization. I added in the references and compiled, saved. Then I uncommented the first half (that was working before as well)

  aLSUA = new LotSelectUpdateAdapter(this.oTrans);
  aLSUA.BOConnect();
  aLSUA.GetNewPartLot(partNb.Value.ToString());

It compiles fine.

The lines with:

LotSelectUpdateDataSet LSUDS = aLSUA.LotSelectUpdateData;
LotSelectUpdateDataSet.PartLotRow plrow = (LotSelectUpdateDataSet.PartLotRow)LSUDS.PartLot[0];

still do not compile. I’m assuming it needs a different reference brought in, but I’m not sure what.

try
var lsDS = aLSUA.LotSelectUpdateData;

That does work! Thank you for your help!!

1 Like

Glad to see my proposal was indeed correct, reaffirms my own understanding. I didn’t explain fully enough though, should have shown the line of code and which bit needed changing. I guess when you tried my suggestion of dropping “Set”, you dropped it from the bit before the equals sign as well as after.