Page 1 of 1

Catch sales order process button click

PostPosted: Wed Sep 07, 2016 5:50 pm
by indikad
I need to catch the sales order process button click ( on sale order form )
I need to catch this before Jiwa does....
The "SalesOrder.ProcessingStart" wont work for me on this case
For example when a order is a reserve order - if users clicks the process button, Jiwa will prompt the users
"Cannot process an order or a reserve order ..."

(this message occurs before the ProcessingStart and never reaches ProcessingStart )

any help is appreciated.

Re: Catch sales order process button click  Topic is solved

PostPosted: Thu Sep 08, 2016 8:03 pm
by Mike.Sheen
indikad wrote:I need to catch the sales order process button click ( on sale order form )
I need to catch this before Jiwa does....


Hi Indika,

You need to add a handler to the toolclick event within the SetupBeforeHandlers method to get in before Jiwa does.

We ship with a standard plugin which does a similar thing - it's called "Sales Order Custom Email" - take a look at that code.

NOTE: You'll see we throw a JiwaFinancials.Jiwa.JiwaApplication.Exceptions.ClientCancelledException in our handler of the toolclick - that instructs Jiwa to abort silently - you want to do that only if you don't want Jiwa to receive the toolclick event after your handler - if you still want Jiwa to process as per normal after your hander, then don't throw that exception.

Mike