Customization issues with Customer Shipment Entry

Hello all,

I’m trying to add a “Retrieve” button to this custom Customer Shipment Entry screen I’ve been working on. I have the button on there and everything and it works if I have it call up a message box or something like that… But when I try making it retrieve the OrderLine information for ShipDtl.OrderLine (after clicking New Line and putting in the Order Num), it gives me a few errors.

I found that the method was GetOrderLineInfo on the CustShip Adapter so I then added this in the assembly reference and what not.

Issues-

  1. If I just have “CustShipAdapter.GetOrderLineInfo();” then it says No overload for method ‘GetOrderLineInfo’ takes 0 arguments

  2. Now I checked the Object Explorer and it gives me this info:

So from there I thought that the arguments for GetOrderLineInfo would be the parameters… So I tried “CustShipAdapter.GetOrderLineInfo(packLine, orderLine, subsPart);” and then it gave me the errors CS0103 - line 60 (1815) - The name ‘packLine’ does not exist in the current context and the same for orderLine and subsPart…

So my question is, how can I define these parameters on the button click so that it calls the method correctly and grabs the line information? Then I would have to do the same for release num.

1 Like

You’ll have to define and assign a integer variable packLine to some value, then pass it into that method.
The documentation of the method uses that sort of syntax so you can understand what the method is consuming, but it’s still on the developer to make sense of it.

Without going into too much detail about what you’re trying to do, you might be able to go after an EpiDataView that exists in the form to get the current values.

Looking in the object explorer for the EpiDataView… It looks like I can grab packLine and orderLine via the ShipDtl table but I’m not too sure where I can find “subsPart” - could I just use packLine and orderLine?

How would I add this to the script? I know they give you an example -

But if I try converting some of this code to c# and place it in the Script Editor it gives me errors… Is there a certain area in the script that this needs to go?
Is this correct: “EpiDataView edvVarName = (EpiDataView)oTrans.EpiDataViews(“ShipDtl”);
Int32 VarName = edvVarName.dataView(edvVarName.Row)(“PackLine”);”

There should already be several native data views within that form, but for a native view, I’d go with something like
Data View:

EpiDataView edvShipDtl = ((EpiDataView)(this.oTrans.EpiDataViews[“ShipDtl”]));

Pack Line:

int packLine = (int)edvShipDtl.dataView[edvShipDtl.Row][“PackLine”];

I tried those two and got this -

I had to remove “this” in the oTrans, otherwise I got an error for that…

Now I’m a little confused with this error

That error is telling you that GetOrderLineInfo doesn’t take 1 argument, like you passed it. Instead, it needs to take 3 arguments, like it defined in your first question. Try creating/setting all the variables that the method wants and pass all 3 into it.

Okay I’ll give that a shot. Thanks for clearing that up

Alright so I added orderLine and subsPart (still don’t know what this is, so i’ll just do PartNum for it) -

but I got this error:

As far as Google goes, the error means that the method GetOrderLineInfo isn’t static and it needs a non-static reference to it? edit: even though it’s under “private static void…”

Where is your reference to the CustShipAdapter?
Also, you’ll want to change OrderNum to OrderLine to get the correct data.

I’m not sure if this is correct - but I added a Part search button on a dashboard before so I copied the overall syntax of that.

Here’s what I’m getting:

If I add static:

Am I doing this wrong?

:slight_smile: Yes, but your spirit is in the right place!

What you did doesn’t solve the problem, but it is a nice way to clean up the code and make it more readable.

I am not sure what adapter exists in the native form, but if you wanted to reference the actual CustShipAdapter, you would first need to use the Customization Wizard to add the correct assemblies associated with the CustShipAdapter.
Comment out the bad line of code before doing any of this.

After that is added, you will want to makes sure you have added the statement at the top of your code (if it doesn’t exist)

using Erp.Adapters;

After that, I usually compile to make sure I can save, then I save and get out and back in.
In your CustGetShip method, you will want to create an adapter.

CustShipAdapter adapterCustShip = new CustShipAdapter(oTrans);
adapterCustShip.BOConnect();
//call your GetOrderLineInfo method here and return something, like a dataset.
adapterCustShip.Dispose();

Always make sure to release the adapter with the Dispose method when you’re done with the call.

Does that make sense? There should be a ton of examples on this site of using adapters.

1 Like

Most of that made sense, yes. But I’m still confused on calling the method…

If I call the method then we’re back to square one with the error “No overload for method ‘GetOrderLineInfo’ takes 0 arguments.” Then I define those arguments and it still has issues…

On a scale of 1-10 for knowledge with C#, I’m at a .05 - so that doesn’t help much.

I looked at a few different threads on adapters on this site and a few others and I read about the BL Tester. So I configured our BL Test tool and ran it for that method and could not get it to run successfully. I first grabbed the method ‘GetByID’ and made sure that pulled in some actual data - which it did… Then I went to the GetOrderLineInfo method and tried pulling data from that and it just kept saying “Records not available” -

Like I said before, I have no idea what “subsPart” is, so I tried a few different things in that field and all came back with that same error.

I’m not sure if I’m going backwards on this, or just hitting a brick wall… Now I’m wondering if this is even possible since I can’t even get the method to run through the BL Tester

Sounds like you’ve made some great progress actually. BL tester is a great way to see how the methods perform with the data. Just make sure it’s pointed at your development environment, because those transactions are real, for all intents and purposes.

Have you used the trace logs before? This is the standard way to see what data is actually being passed into the methods.

To turn on tracing, click this icon on the black bar at the bottom of the screen:
image

I then turn on trace logging and select Track Changes only
image

This will then write a log out to that file for whats happening. To view the log, click View.

The second suggestion I have is to download the Epicor BO Reference program off the EpicWeb. This is the documentation of the actual methods. It can be helpful for understanding what the method consumes and produces.

Sometimes, methods are dependent on the dataset being filled out in a previous method. It looks like you’re doing that with the GetByID method, but your trace log of a transaction that triggers this method will be much more indicative of the order of events that need to fire before this method is ready to be called.

I have messed around with the trace log and in the past it wasn’t very helpful… But that task didn’t have anything to do with the methods and it looks like it’ll help with this.

It looks like when I go to the Line information and add a new one and type in an existing order number it uses the method GetOrderInfo off of the orderNum, creditMessage, and ds parameters. [11273] ,[], and CustShipDataSet - then I think using the data set it changes a bunch of values -

Then the next method is GetManifestInfo which I assume is just grabbing the “Manifest Info” tab data and by looking at the log it looks like that’s what its doing.

Next comes the BuildShipToCustomerList which just grabs the shipToCustomerList parameter and the orderNum parameter…

Then there’s the CheckPrePartInfo -

And then finally the method we need; GetOrderLineInfo which looks like:

So now my question is, how do I retrieve the CDATA/parameter information off of the data set using C#? The thing is, with this custom screen the line and release should always be 1 and 1 (bad example above) - so maybe it would be easier to just hard code that in? But I’d also like to learn how to retrieve data and use that data for the parameters…

To retrieve data from an adapter dataset, you could do something like:

string custID = adapterCust.CustomerData.Customer.Rows[0][“CustID”].ToString();

If you look in the object explorer, you will see properties associated with the adapter and the “data” is held on one or more of these properties.

One thing to note: look at the PackLine parameter going into the method. It’s a “0”, not “1” like you put in the BL tester. Can you try your BL tester again with 0? Because this method fires when it’s looking to get the data associated with a new line, I would imaging it sees the new pack line row 0 in all cases.

I tried the BL Tester again with 0, but it gave me the same error…

Does this look correct to you? -

Edit: got a meeting in a minute, but I tested the retrieve button with the above and unfortunately it didn’t do anything

Code does look kosher, however remember that the method call itself returns a boolean. We know that this is changing the dataset of the adapter, so we will want to do something that that data.

Which is a good segue into the question, what are you trying to accomplish with this?

We are going to be getting these new orders that are completely separate from all of our other orders. The items/parts are going to be at an outside warehouse, there’s going to be different rules for the shipping labels, etc…

So I’m trying to create a Customer Shipment Entry screen that will “automate” the shipping process for only these orders.

Here’s a pic of the screen so far (I haven’t cleaned it up yet - so it’s a little ugly)

But my goal for just this section is to retrieve the line/rel info using that retrieve button, which then brings in the qtys and what not.

There’s a few more things that I need to add to automate this process, but I figured the retrieve button is a good start. Here’s a little list of the things that I want automatic/semi-automatic

  • Line/Rel Retrieval
  • Put “1” under “our ship qty”
  • Pull in a specific package code everytime
  • Maybe marked it as Shipped after a successful freight *not sure if operations wants this yet

Also another goal for this I had was to add a Freight button which will change the workstation to this specific workstation that’s setup in Manifest, then actually freight it (labels print), and then revert the workstation back to what it was originally.

Some of this stuff is a lot harder than the others, but there’s a few reasons why I’d really like to do this.

  1. It’d make printing a lot of these orders much more efficient
  2. I’d learn a lot more about BPMs/Methods/Customizations

What is different about these orders and do they get generated in the same way? If I were to query the sales order table(s), what would be different?

Is the form you are customizing built upon the existing Customer Shipment Entry form or are you doing something different?
Building on the existing form will present both advantages and disadvantages, mainly that you will need to contend with the existing logic built into that form. That can be challenging if you are trying to do everything “custom” using the same form.

If you were to create a query to search for these you would most likely just add a filter where PartNum STARTSWITH “3.”
Since all of these orders are going to have these new parts that start with 3.NFL…

I’m currently using the existing Customer Shipment Entry form - I figured that would be the best way to get all the same functions, as in the freight method(or however that’s controlled), correct qtys, etc. There’s a ton of fields on here that aren’t DB Fields as well, which I think would be impossible (or very difficult) to bind to a custom form’s fields…

I believe these orders will be generated the same way as most of the other orders do, it’s just going to have a different part number on the lines…

You posted-

however remember that the method call itself returns a boolean. We know that this is changing the dataset of the adapter, so we will want to do something that that data.

Could you treat me like a 10 year old and explain what I need to do here?