How do I stop a process counter sale if the credit card order box is not checked?

Hello,

I have been asked to stop a sales order counter sale when they click the ‘Process Counter Sale’ button if the credit card order checkbox is not checked.

I ran a trace and the obvious process is ‘SalesOrder.ProcessCounterSale’.

I have tried messages on this to make sure it is gettng the data and I get nothing to show.

So does anyone know which process to use in BPM to stop a counter sale when the button is pushed?

Any help is appreciated.

If that’s what the trace shows, throw an error instead and see what happens.

I am trying from post processing method.

I hooked up the raise exception to it directly and told it to show the field values for:

CounterSale
CreditCardOrder
RowMod

I pressed the button and the exception did trigger but none of the field values would show.

If I can’t see the values, I can’t get the condition to work.

I did try putting a condition in between the start and the exception.

It is set for
image

I tried other variations of all rows like updated and changed, nothing triggered.

Any ideas how to get a condition to work?

Start with this issue.

The fields you need are frequently not directly available (depends on the method).
So you have to 1) figure out what fields you do have at your disposal and 2) use those to query what you need.

I usually just fire a email to myself and insert whatever variables are available.
In this case, order number would be useful. If that’s not blank, you can use it as a parameter in a Fill Table by Query widget. I think you also need a Sales Order Tableset variable to put your query results in, and THEN you can check those values.

1 Like

Hello,

I can kind of follow what you are saying.

I can confirm the IorderNum does show the orderNum.

I just am not sure how to do the rest of what you are saying.

When I look at fill table by query, I don’t see an option to point to a sales order Tableset.

Can you give me a bit more direction please?

Hello again,

I created a SalesOrderTableset and named it bob to stick out as a test.

I then did a ‘Fill Table by Query’.

For the query, I did OrderHed table and fields: Company, OrderNum, CounterSale, CreditCardOrder

I then selected bob.OrderHed table to write to.

I am a bit confused on the configured mapping though.

What do I fill out there?

I tried:
Company = field: OrderHed_Company
OrderNum = var: iOrderNum
CounterSale = field: OrderHed_CounterSale
CreditCardOrder = field: OrderHed_CreditCardOrder

I then mapped those field to the exception to see if it printed anything then.

When I tested, I got a lot of Trues and Falses instead of one for each field I mapped.

Where did I go wrong?

Hello,

I think I figured it out.

I had to do a table criteria in the fill table by query.

Once I did that, it started returning single results instead of a lot of them.

Now that I know this, I can get this going. Thanks!

I really appreciate your help!

1 Like

nice! yeah I was working on more steps, but you got it!
happy to help! :grinning_face:

1 Like