I am seeing something odd on a BPM that I’ve never seen before, when using a “Raise Exception” widget. I have a Post-Processing BPM on JobEntry.GetByID method that I am using in Job Receipt to Inventory to warn users when trying to receive a Make-to-Job/Order job to inventory instead.
Using a Show Message widget, it works perfectly fine displaying the message that I entered, however that doesn’t stop the details from loading and they want a hard stop here. So I copied the message over to the Raise Exception widget and set it as the action after my condition is true. But in the Job Receipt to Inventory form, I get a generic “Invalid Job Number” error (shown in screenshot below), instead of my custom message.
Any ideas why this is happening and how I can get my custom message to show instead?
The raised exception is doing the correct thing, but I would like to give my users a more detailed message that tells them why it’s an “invalid” job within this screen (job I’m using to test comes up fine in Job Entry/Tracker and Job Receipt to Job).
My BPM doesn’t work in pre-processing as currently designed.
Is post-process the same reason why my Raise Exception message won’t display, instead of a generic error message? Everything else works perfectly, so I just want this to work, too.
I created a Pre-processing directive on the ReceiptsFromMfg.PreUpdate, added a “Show Message” widget with “BPM Triggered” text to check that the BPM is firing, and then added an “Execute Custom Code” widget that I pasted your code into.
When I pulled into Job Receipt to Inventory a job with Make-to-Job demand link, it loaded all details without ever giving me any kind of message. Also tested with a job that has a Make-to-Order demand link with same results.
When you click OK, to do the job receipt PreUpdate is run to verify the transaction is good. This check is Before that and stops it if there are no make to stock jobprod links.
If you go thru the process to do a receipt it should stop or you can see the bpm progress in the event viewer on the server.
I need it to happen before the details are pulled into the form, hence why I was doing it on the JobEntry.GetByID method, as indicated in the trace I ran on the form.
Do you know how I can compare the JobNum parameter to the details on the JobProd table, so that I can check for an OrderNum or TargetJobNum on that table for the related Job?
Disregard. I got the conditions to trigger correctly, but for some reason I’m still getting the generic-looking “Invalid Job Number” error message when I add a “Raise Exception” widget to the BPM, instead of my designed message.