I’ve got some custom code in Erp.CustShip.GetByID that is supposed to check for some conditions to be true, and if so, display a message that shipping is not allowed and prevent shipping from occurring.
My understanding is that to throw the actual exception, I need to call CallContext.Current.ExceptionManager.AddBLException() with a string containing the error message. If I’m in Customer Shipment Entry with the test record already loaded and hit refresh, the exception comes up - but the record is still displayed, meaning that shipping is still possible. This isn’t a problem as this is just for testing and in production the record wouldn’t be up in the first place. It does show the BPM is otherwise functioning as expected and proves out the logic.
But if I clear the record and try to re-enter the packing slip number, it says “Record not found. Add new?” I assume the exception is somehow interfering and causing this, but I don’t even see my exception message!
I’ve tried this using both a pre-processing and post-processing method, but both have the same behavior.