All done, and I enabled it this morning. Now I wait for the screams.
Seriously, though, this is beta for sure. I have tested it, but my users will find out if I missed anything.
Here are the files.
BPM is a Data Directive on RcvDtl table (group is “OverRec”)
Function Library is “Receiving” - that’s important to know since the BPM calls the function by name, so if you want to give the library a different name (in the import), then you would need to edit the C# block in the BPM.
(“Generic” is because in the text of the error message I edited out my company name and “ask Jason” at the end because that would be weird at your company…)
Again, I just want to say how awesome this is to be able to throw an error from a Data Directive but have a clean way to do the calculations in a Function (or two) - since most of the info I need is not in the Data Directive natively (because it comes from other tables).
Thank you again to @A.Baeisa for the technical help on summing a field in a one-line statement; that was critical to this project.
For any Yan Can Cook fans out there, “If Jason can code, so can you!”
Apologies, I might have missed something earlier. It’s kinda hard to see exactly how this is constructed because the functionality is blown across all those widgets.
Personally, I’d shove everything into a single LINQ expression in a function and call said function from one of the qty update methods in receipt entry.