BPM to set field blank on Copy Order

I am trying to set the OrderRel.Reference field to blank when the order is copied. Anyone know how to do this?

Run a trace when performing copy order to find the method to hook into. I believe one of the methods that is called is CheckLtrOfCredit. Is it only copied orders which is essentially a new order, so you could also use a data directive on orderhed where row state is Added.

Edit: actually I think there is a copy order method. Maybe a pre processing method dir on that? I try and use data dirs as a last resort

Post processing on CopyOrder should do it. You may need to use some Method widgets though.

2 Likes

I understand tracing and know where to place the BPM itself. I am having trouble understanding Invoking Methods, what they do and what BO I should be calling with them, as well as what the paramaters are. Is there any post on here where I can find this information or can someone give me an example so I can build a better understanding?

The trace tells you the methods being called and their parameters.

Ok so here is my trace. Should I be calling all of the BO in this trace from PreCopyOrder to DynamicQueryImpl? It seems like I shouldnt have to call all of those just to set a field on OrderRel. It looks like to me that in the DynamicQueryImpl.GetList its copying the order data there. Would I be somehow setting the field after that?

copyorder2.xml (776.4 KB)

Here is a snip of my directive.

The Dynamic Query is not standard logic. It may have data you wish to see, but it is not the method you need.
It looks like you are on the right path. You do NOT want to ignore the SalesOrderTableset as that is the data you need to change. You may need to use code to set the RowMod = “U” (or Fill Table By Query may have this feature). Then run an update.

I have the bpm set up and displaying the correct data in the message box, but it is not actually applying those values to the field.

Any idea where I am messing up?

First message box showing the new ordernum as well as the current orderrel.reference data.
Msg1

Showing the new ordernum and text being changed to (from the set field widget)
Msg2

BPM Setup!



Could you simply use a data directive there and set the field to blank?

This would need to be done with the custom code correct?

No. Just simply a Set Field.

Couldn’t be done with a standard directive of course, but it seems to work as an In-Transition.

Yes. You are correct.