Add or Edit any Operation - My Custom Dashboards

I am not sure on the specifics, but I think that at some point in the last year, a few new key fields were added to some tables. Notably, AltMethod and ProcessMfgID. Once these became requirements, I just pass empty strings for the values, and it seems to work.

To see what changes you might have to make, you have to do a little extra work. You have to add a new method to the BPM for each method that uses those new fields. As an example, open the BPM and go to the bottom. There is a method called CheckIn. Look at the parameters for this method and you should see those two fields (row 4 and 5).

Now go to the menu on the left and find Invoke BO Method. Drag that sucker onto the page next to the CheckIn Method. You don’t have to connect anything just yet.

Configure the new method you added to be setup just like the CheckIn. Click “specified” to choose the BO and method. The Service Name will be EngWorkBench, and the Method is CheckIn. Now click on “not configured” to see the method parameters. Do you have rows 4 and 5 that show AltMethod, and ProcessMfgID?

If you do have those fields, then I am not sure what is going on. You should be able to sue my original files. If you don’t have the fields. Then you can replace my check in method with your check in method. Just make sure to set all the parameters the same.

There are a few other methods in this BPM that use those fields. I think: CheckIn, CheckOut, and GetDatasetForTree, should be the only ones.

This was a lot of work to setup initially, so kudos for diving in! Happy to help any way I can.
Good luck!

1 Like

For some reason, the ipProcessMfgID wasn’t listed on the Invoke bo methods that came in on the original BAQ. After replacing those with new ones and configuring them the same way you had those errors are now gone.

The next error now seems to be with a parameter having a null value:

Is this error from the BPM, or from the custom code in the dashboard?
This section of the customization code on the dash is the only part that I can see that uses type:

	private void BAQRunCustomAction(EpiDataView iEdv, string iActionID)
	{
	    BAQDataView BAQView = (BAQDataView)iEdv;
	    Assembly assembly = Assembly.LoadFrom("Ice.Lib.EpiClientLib.dll");
	    Type t = assembly.GetType("Ice.Lib.Framework.BAQUpdater");
	    BindingFlags bf = BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy;
	    MethodInfo mi = t.GetMethod("BAQRunCustomAction", bf);
	    object[] param = new object[] { BAQView, iActionID};
	    mi.Invoke("Ice.Lib.Framework.BAQUpdater", param);
	}

I also don’t see any issues with this code. In the dashboard custom code, make sure you have the custom assemblies reference:
Erp.Adapters.EngWorkBench
Erp.Adapters.PartRevSearch
Ice.Contracts.BO.DynamicQuery
These should pull in automatically. You will need that last one for sure to use the function above.

1 Like

Getting closer!

Those assembly references were missing. Once added I got an error that said the bpm was outdated. So I checked it as good and ran the dashboard again.

I am now getting the following error:

I checked the part im using and it only has one approved revision.

1 Like

I think this happens if the process doesn’t run all the way through. I assume you have already created the EngWB ECO group that matches your username. I also assume you are running in Pilot for testing.

Open EngWB, and look at the parts you have checked out. Go to Actions, and Approve and Check In All.
This will get rid of any revs you still have checked out. If the BPM doesn’t get all the way to the end, this is where you have to look to make sure you get the parts checked back in. Once it is working well, you shouldn’t need to look in EngWB.

I believe the BPM expects only one rev to be checked out at a time.

1 Like

Its still giving me the error even after check in and approve all. Does this bpm look at only approved revisions?

That is a slippery error. I hate to advise this, but you may have to debug the BPM widgets. I put a Test Stop message box in there to use for just this reason. In order to figure out which widget is generating that error we need to be able to stop the code at various points.

Look for the Test Stop widget. It should be at the end of a row of about 4 widgets. I think everything above this point is probably fine.* Disconnect the output of that last update method and attach the update to the test stop. Don’t attach anything else after that.

We are seeing if the code will run up to this point and have the proper values in the underlying datasets. The TestStop gives you a place to put those values for inspection. I have already put in most of what you will be interested in. Not connecting anything else after allows the BPM to run without error (if your test stop is before the widget that errors.)

After you setup that first test stop, save and run the BPM. It should run all the way up to the stop and then show the message box with the values you care about. If you get good values in the test stop, then open the BPM workflow designer back up, and disconnect the test stop and move it to the end of the next row of widgets.

Keep repeating this until you figure out where the error is occurring. If you narrow it down to a row of widgets, then insert that test stop between each widget one at a time and retest the BPM.

Note that while you are testing in this way, the eng wb is getting populated with records, so in between you may want to keep Eng WB open to clear it out (check in all) between tests.

*I put the test stop at the point where I was last using it, (near Update4). If you still get that error when testing with the test stop, then you need to move the test stop even earlier. Note the original connection layout, then disconnect a widget, and insert the test stop. Once you have tested it, you will have to reconnect the widgets as they were originally.

I can’t say which widget is the most likely cause. I had to trace this error over and over again until I finally got it working. Mostly because of how unwieldy the BPM widget map is. I think if you look at each step it is pretty clear what is supposed to happen. Happy to keep working with you to get it going again. I hope you can get it working!

1 Like

Back at it again. This time with a new error:

I have confirmed that this part does indeed have an op 100 on the selected revision.Any ideas on where to start hunting this error?

Sorry I’m not really contributing to the current questions, but why is this code in here?
Why not just reference it directly instead of via reflection?

I think I stole that code from someone that knows a lot more than me. I probably got it from this forum a few years ago. What would you replace it with?

This is another case where I have to debug step by step. Break the widget tree at various points, tuck in the message box so the code will finish on the message box. Keep breaking, inserting the message, and reconnecting until you get that error again and not the message box. That helps point to the widget that is causing the problem. Does that make sense?

1 Like

Something like this:

Direct reference:

DynamicQueryAdapter dQ = new DynamicQueryAdapter(this.oTrans);

dQ.BOConnect();

queryResultDataSet = new System.Data.DataSet();

dQ.RunCustomAction(queryId, actionId, queryResultDataSet);

dQ.Dispose()

I’ll have to give this a shot and add it to my bag of tricks. Thanks!

I got it working. I’m just a goober and had the flow run straight into an error. Must have happened when I went through and replaced the GetDsTree and Checkin/out chunks. This is absolutely awesome!

1 Like

Can you post updates for Kinetics?

Perhaps, someday I will get it converted. This is one conversion that gave me lots of trouble and I gave up on moving it to kinetic more than three times. I’ll try again at some point and if I get a good conversion I would be happy to post it (if I can figure that part out!) :stuck_out_tongue:

Will this run in classic mode on Epicor 11?

Yes. I wrote it in Modern. Classic and Modern are the same thing.

Nate I get the following error when trying to Import the getPartRevECOs.baq and getPartRev.baq

Can’t import query definition from version latter than current: 4.2.200.0
Query import finished with error(s)

Thankfully these are both easy BAQs to reproduce. For the first one

select 
	[ECORev].[GroupID] as [ECORev_GroupID],
	[ECORev].[PartNum] as [ECORev_PartNum],
	[ECORev].[RevisionNum] as [ECORev_RevisionNum],
	[ECORev].[CheckedOut] as [ECORev_CheckedOut]
from Erp.ECORev as ECORev
where (ECORev.PartNum = @part  and ECORev.RevisionNum = @rev  and ECORev.GroupID = @ECOGroup  and ECORev.CheckedOut = true)

And for the second one:

select 
	[PartRev].[RevisionNum] as [PartRev_RevisionNum],
	[PartRev].[RevShortDesc] as [PartRev_RevShortDesc]
from Erp.PartRev as PartRev
where (PartRev.PartNum = @part)

As long as you name the BAQs the same, you shouldn’t have to change any code in the BPMs.
Good luck!
Nate