BPM Custom code


I have created a pre processing directive in my sales order to get the sum of my order lines. If total qty is less than 40 then I have a pop up message, if total qty is greater than 40 then I enable my post directive to update my docunit price. The pre processing directive works great. But then, I am in need of help in my post processing custom code. I want to say that if my total qty is greater than 40 then update my docunit price:

for partnum that starts with
MSOCON12CV90 = $115.59
MSOCON12FT600 = $113.26
MSOCON24CV90 = $172.74

I am stuck in this below code, which updates the doc unit price of all my lines to 115 only.

"foreach(var orderDtl in ttOrderDtl.Where(r =>!r.Updated() && !r.Added()))

orderDtl.DocUnitPrice = 115;

Any help would be appreciated.

Thank you

You are trying to edit in a post processing… unless you add a save action it will not get saved. (and maybe create a loop ?)

I may suggest to perform the price modification in your pre-processing… You said it is already working to detect the greater than 40… Put your code then… It will get saved automatically !