BPM to set price based on ship to

All -

I am struggling with what I think should be a very easy BPM and I am struggling with how to make it fire.

The logic is; if CustNum = 1 and PartNum = ABC and ShipTo Num = 2 and Qty > 0, then UnitPrice = 12.

This logic should overwrite the normal discount prices based on customer and part (and, really if ShipTo were not a condition, I could just make it another price list!).

Having tried all sorts of thing to no avail, I am now just trying to create the condition to something work. I have tried both post-processing and base processing on SalesOrder.ApplyOrderBasedDiscounts. And the only condition is that the ttOrderHed.CustNum field of the updated row is equal to the 1… expression.

And all I want it to do is show a message so I can see that it’s working.

Is there another way to think about this? It really seems like it should be easier than this.

Thanks.

To help with trouble shooting, use the table query in a pop up message in the BPM. You can see the data of the rows that are being returned. Grab a message box widget then in the white space, right click, table query. Click the fields that are relevant, also make sure you gran the row mod. Some methods send in the new and the old row, so you will have to know if you need to filter out the old one.

Post a screen shot of your conditions. That will help someone spot of you have a simple error.

You should stay away from base processing, There are only a few rare cases that you will use that one. Pre-processing is probably the one you want here.

I know that I want to stay away from base processing, but I thought that if I used pre-processing then the base processing would overwrite my fixed value (12) with the usual value from the price list because it would fire after my fixed value. Post processing (where I wanted to overwrite the results of the base processing didn’t do anything, which is why I was moving further back up the process).

Will try go grab a screen shot.

Sometimes you have to get the criteria set in pre-processing, then you have to set an enable post processing in the pre-processing to fire off the post processing. Usually because in post, it’s hard to tell what type of row it is. It doesn’t always have the row mod.

If you get a utility like greenshot, screen shots are easy. You can past them right into the forum, so you don’t even have to save the images to your computer.

So I have changed the BPM to a pre-processing on ApplyOrderBased… and all I want it to do is display a message. The message is composed of the relevant fields, including RowMod.

Still nothing, but have screenshots of everything. I will paste them below and also attach as .pdfSpecialPricing 20190226 1632.pdf (234.4 KB)

Here goes:



Thanks for looking at this.

So, with no conditions, do you get a message box? What does the row show when you do it that way?

Also/or, put a message box on both the false and the true side. Make sure you put something in the the mesage so you know which one went. Then you know when it should be going for sure.

I also apologize for the all of the crappy typing and editing. I’m on my phone.

OK, added a “this is the false message” to be displayed on the false side. Still no message box displayed. So it seems like the BPM is not firing at all, even though it appears that the method (ApplyOrderBasedDiscounts) is being called (invoked?) because when I change the line quantity, the UnitPrice does change in accordance with the price list rules.

1 Like

So we learned something there. That’s why it’s good to set it up that way. We didn’t discuss why you picked that method. Does it run in the trace? Did you run a trace?

I picked that method because it seemed logical for what I wanted to do, which was to overwrite the price calculated by the price list. And, btw, no message is displayed when I remove the condition. I

Did not run a trace (have never done so – am very new to all this). If there is an easy way to explain how to do so, I will take it. But I don’t want to take up your time writing out something that I can look up.

Thanks.

Ca I ask why you didn’t create a price list with price breaks and apply only to the ship to on that customer rather than the customer? Did that not work?

1 Like

My understanding of price lists is that they get down to customer and part. Can I put a ShipTo condition on a price list? That would be ideal!!!

Because I was thinking about it incorrectly. I see that I can add a Price List to a ShipTo. I think that will solve this. Thanks so much.

1 Like

to run a trace, right click in the home screen. This will bring up this menu. Tracing options are here. (they are also the in settings section)

image

It’s best to close your task agent. Not doing this will add some things into the trace that aren’t related to what you are doing. (just keep in mind you can’t print until you start it back up)
image

Then you set up your options for the trace. Apply, then clear the log. If you click view, it should open up a blank notepad screen at this point.

Keep this screen visible and handy. Dual screens really help

After than get everything set up to right before the event you want to capture. Click clear log again. Then do whatever it is you want to do. After that view your trace.

Get that done, then post the text here. And I’ll walk you through what it means.

If that works, that is definitely a better solution.

Thanks. Will do this a bit later because I want to know how to do it on general principle. Going to try the other option first, just to get the pricing done.

1 Like

Tracing is super helpful/necessary if you are going to write BPMs, or many customizations. It’s good tool to have in your belt.