Hi,
I tried creating a Method Directive that will raise and exception when there is an update to the Quote Table. I went back and forth with Epicor Help and they suggested a customization. The exception is supposed to be trigger every time the Quoted field on the Quote Header is clicked and the Sales Category field on the Quote detail is blank. Below is a screenshot of the Methos directive crated that does not trigger when is supposed to.
Personally, I would use a BPM like you’ve started. It’s tough to tell what your MyQuery is returning. When I’m trying to figure out why a BPM isn’t doing what I expect, I make sure to split my conditions so instead of having 2 conditions in the same block, I’ll make them each their own condition widget. Then at each outlet of the condition, I put a Show Message widget with a note about which part of the logic tree I’m in. That way when I save the Quote, I’ll get some kind of message that says where it’s at. Then you can figure out which part isn’t working as intended.
In your specific example, I don’t think you need another query. Just look for the field like you did in the first condition row. But break it into two condition blocks so you can see which part isn’t working as expected. Then when you get it figured out, you can remove any helper message boxes. Also, if you want to Raise Exception, use the Raise Exception widget, not the Show Message widget.
P.S. Welcome to the community. Everyone in here is super helpful and in almost every case, someone has been where you’re at and has some helpful tips and tricks and can point you in the right direction.
@Rvandeman To @dr_dan’s point I think this is a clear case of a bpm being the right direction. I would add a message before the condition to see what RowMod is in case it is Updated and changed is not getting triggered.
I did a couple of bpms like this last week on sales order and just used one query.
Yours would be quoted = true and Category = string.Empty or “” depending on your version.
You might need to check the Added row as well as the Changed row. I usually have to put a line for Added as Epicor doesn’t consider a new row as Changed.
Incase if you would like to go with custom code, you can do the following:
create a in-trans at QuoteHed and a custom code as widget.
In addition to what all said, I mixed up the conditions and it worked well for me, give it a try?, you could use for your future reference.
Code: