MES Customization DataView

Currently I am working on some customization for the start production activity I have to grab the part number and use that to find the work instructions link in another table. I’m able to pull up the instructions for a part number however I need help trying to get the current data view so that I can get the part number based on the job number.

EpiDataView CurrentView = ((EpiDataView)(oTrans.EpiDataViews[“Start”]));
string jobNum = CurrentView.dataView.Table.Rows[“JobNum”].ToString();

This is what I’m doing now, but every time I try to print the job number I get “Object reference not set to an instance of an object.” Exception

I think it should be like this, according to the Object Explorer.

EpiDataView CurrentView = ((EpiDataView)(oTrans.EpiDataViews[“Start”]));
string jobNum = CurrentView.dataView[CurrentView.Row][“JobNum”].ToString();

Nope that is still giving me the same exception I should also mention I have it in a

oTrans_laborAdapter_AfterAdapterMethod(object sender, AfterAdapterMethodArgs args)

method because it has to pull up the instruction after the operation for the job is selected.

Have you stepped through the code in VS debug?

I don’t have it connected to vs I should probably try that would I be able to connect it with vs 2013 that’s the version that we use.

I think so?? If you have it installed on your machine, when you open the customization, there is a checkbox to debug in VS. See if that check box is available.

I try running it, but vs 2010 shell starts running and I get a licensing error.

When I check again the check box is unavailable now.

If you start VS in debug, and then quit VS, debug is not longer available in that session. You have to restart Epicor. I’m not sure why, and it’s kind of a pain. For me the Epicor system fires up 2015. I also have 2017 and 2019 installed.

Yah every time I restart Epicor and select debug in vs it still tries to open up vs 2010 shell

Maybe this might be related? It’s a little over my head.

we use 10.0.700.4 sadly

I found out that my main issue is the form event I am using I was using a after adapter event which clears the rows so there is nothing for me to grab. When I use a list change event I am able to get the info I need, however I now need to figure out how to run the list changed event after the BPM that validates the information on submission.

You should be able to set BPM context fields to be able to filter out when code fires. I think they are available in the client side :thinking:

The BPM has to run when Ok is clicked and the list changed has to run after that. Can I do that with the call context bpm data

A BPM will only run when the system makes a call to the server. There isn’t a “button calls a BPM” function that I know of, so you have to find some process to hang it on. Whether it be update or something like that. You would use call context data to make sure it’s firing only when you click the button, because that method will probably be called other times.