BPM logic not correct?

I have a pre-processing method directive on sales order update to check if the order review checkboxes have been checked and then set the line on hold checkbox based on that. I think my logic is sound but I am getting unexpected results. I’ve tried with post processing and data directives. I’ve deleted everything and started from the beginning. I can’t figure out where the issue is :frowning:

  1. Number of rows in my query is not less than 1 (if any of the boxes are unchecked it will return the line)

  2. Show message that all reviews are not complete and the line is on hold

  3. Set on hold field to true

  4. Message that all reviews are complete and line is not on hold

  5. Set on hold field to false.

In action:
Unchecked Engineering and everything works:

Checked Engineering so all reviews are complete - I expect the message that the query is less than 1 and all reviews are done

If I uncheck Hold and save

From what I understand, ttAnyGivenTable holds double information – the old record and the new record. They are differentiated by the RowMod field.

Try adding a criteria in that query of RowMod = "U" maybe?

Heads up, it’s C#, so you need quotes, not apostrophes.

1 Like

I think Jason’s probably nailed the issue. If I had custom code logic doing what you’re trying to do, I’d need the condition looking at RowMod.

Usually if you’ve got a widget type item like “specified constant”, you don’t need to add the quotes around it as Epicor’s BPM logic will wrap the quotes around what you put in. I think it’s not consistent in 100% of the cases. If you just enter U without the double-quotes around it, it will give you an error if you need it.

Also, you might want to consider creating your own field names for the checkboxes, so call them “Appv_InitialSales_c”, “Appv_Engineering_c”, and so on instead of CheckBox08, CheckBox09, etc. You and people who follow you will thank you for it. I realize you may have inherited this and those checkboxes are embedded all over your system, but might be worth the effort to move them.

1 Like

That was the issue. I think I’m so used to the widgets letting me pick of the updated row I didn’t even notice it wasn’t there :slight_smile:

1 Like