BPM Form Usage

I know how to use a BPM form in the most basic sense thanks to @josecgomez. I am curious about more advanced usage now.

I am looking to write a solution for multi-label printing on ReceiveDtl. I know it would be easy enough to write the solution into the receiving form but some strange urge whispered use a BPM.

Similar to the standard print tags form, there will be a grid that allows me to print multiple labels with varying quantities. I will have the total equal to the receive quantity.

I imagine customizing the BPM form and adding what I like, but how do I access that information? Can I stuff it into a context variable? Do I need to make some hidden fields and use those? Any thoughts?

Just stuff the stuff you want into the CallContext fields.

2 Likes

I already know this is going to be something stupid (I predict you can only use BPM forms on certain types of BPMs)…

Why don’t I have the BPM Form listed in my CALLERS panel on a Data Directive?

Because data directives happen at the Data Layer not the Business Layer. Data Directives get triggered from all sorts of places including from inside other methods. So I imagine it is a really hard problem to solve to put a BPM data form that needs to be displayed at that level and be able to figure out where in the call stack the screen should pop up.

2 Likes

Fair enough, thanks!

Is this a limitation of a BPM form? If I try to process more than one record…

Business Layer Exception

The table ttRcvDtl has more than one record

Exception caught in: Epicor.ServiceModel

Error Detail

Description: The table ttRcvDtl has more than one record
Program: Epicor.Customization.BPM.dll
Method: GetSingleRow

What are you trying to do to trigger this error?

I have a post method directive on ReceiveAll. If on the MASS REC screen I have multiple records, this error occurs

Right but what is your actual BPM doing?

Nothing much right now :slight_smile:

Set Field to Show PN on form (Character01)
Run BPM Form
Show Message Box for debugging

(It’s that pesky set data field causing the problem isn’t it?)

What are you setting it to?

Character01 = ttRecDtl.PartNum

Try ttRecDtl.FirstOrDefault().PartNum
Since ttRecDtl is a table.

K, to confirm, removing the set field causes the error to go away. Trying your suggestion now.

Yep that fixed it. Thanks sir!

How can I gracefully cancel a BPM form programmatically? Closing normally gives: input was cancelled by user exception.

I’ve tried OKbtn.PerformClick() - no response
I’ve tried manually setting BPMData.ButtonValue - Can’t set ButtonValue exception

Aside from that, it’s working nicely

Normally I remove the ControlBox in the for via customization and add a Cancel button bound to ButtonValue =1112

Ok, but how do I programmatically close the form?

In my case, if the part records passed have a rec’v qty of 0, I don’t process them. If in the strange case there are no parts with any quantities passed in, I want to silently and gracefully close the window.

Why don’t you not call the form unless you need to? Put a condition before calling the form that checks to see if you need the form.

Because I haven’t learned how to properly use the Custom Code Condition lol