I need to create a way to stop a record save and show an error.
Task: I need to stop an OrderDtl record from being saved if the PartNum is a specific part like PART_A and the DocDspUnitPrice is 0.00
Work So Far
If you update either of these fields, they fire a different Method under the SalesOrder BO. So, I’m thinking I’ll have to write the same BPM twice (once for each method)
So, I started with the method on Changing the UnitPrice.
Once in the BPM I check if the values that are being saved match the criteria and if so, throw an exception.
I did this in a pre-processing directive and the values coming into the “changed rows” in a condition node were the existing field values, not the new ones. So I could not seem to get it to compare to the incoming data. But I could make it throw the exception without issue.
I tried it in a base-processing directive and the values coming into the “changed rows” in a condition node were the new field values, so the comparison worked correctly. However, when I then fire the exception, it does stop the save from happening, but the error message does not show in the interface.
Questions:
- Is the lack of error message in base-processing expected behavior?
- Is there a better way to trigger this task since there are two entry points (changing part # or changing DocDspUnitPrice)