Page 2 of 2

Re: Sales Order Processing Screen

PostPosted: Fri Feb 21, 2020 2:49 pm
by pricerc
So attached is my plugin which adds an "Order No" filter to the batch sales processing screen.

If your filter's stored procedure has the string 'AERP' in the name, it will run a custom version of the candidate population logic, adding the "Order No" filter to the logic. It will also put the Order No into the "Remark" field in the candidate list.

If your filter's stored procedure does not have the string 'AERP' in the name, it will run the standard JIWA logic.

The current use-case for my customer's requirement is the default value for the Order No filter, which is used in a CHARINDEX clause in the stored procedure; this could easily be changed to use a 'LIKE' clause instead.

My stored procedure also returns 'Active' orders and excludes credit notes.

The SQL Script is in the plugin documents. It also includes a test execution of the stored procedure so that you can make sure it's returning useful data before trying to use it in JIWA.

Unlike the manual BO process customisation referenced at the start of this thread, this doesn't need reflection.

I also dabbled with disabling some of the filters, there are some commented-out lines for this in the setup method.

ProcessingScreenShot.png
Screen shot

Re: Sales Order Processing Screen

PostPosted: Sat Feb 22, 2020 8:19 am
by SBarnes
Hi Ryan,

Having a quick look at you code you largely did the same thing I did except that you added a control to the form where as I used add column on the ranges grid, but then we both took over control og the click of the button and threw a client cancelled exception to stop Jiwa's button click.

Same principle just applied in a slightly different way.

Re: Sales Order Processing Screen

PostPosted: Fri Feb 28, 2020 2:28 pm
by pricerc
Ok, so related question.

I've processed a bunch of orders through this screen.

If I want to go and print them through batch printing, is there a clever way of identifying the ones I've just processed?

Re: Sales Order Processing Screen

PostPosted: Fri Feb 28, 2020 2:34 pm
by SBarnes
I would suggest a custom field on the order and put the process run number there, of course your other option would be to print them as you process them.

I am pretty sure you can update a custom field on a processed order as I can tell you the ui will let you do it.

Re: Sales Order Processing Screen

PostPosted: Fri Feb 28, 2020 5:28 pm
by Mike.Sheen
pricerc wrote:Ok, so related question.

I've processed a bunch of orders through this screen.

If I want to go and print them through batch printing, is there a clever way of identifying the ones I've just processed?


Add a handler to the OnProcessStart and OnProcessEnd events, and in the OnProcessStart handler, add a handler for the Removed event of the ProcessCandidates collection - the removed event gets raised after successful processing of each sales order. And in that Removed handler, you can add to your own list of what was processed.

Then, in the OnProcessEnd handler, remove your handler for the ProcessCandidates.Removed, and then you can do your printing.

If you wanted to invoke just one report with all sales orders identified as being in the batch just processed, then you can use the SO_History.RunNo of anything in your collection to find cohorts. The other option is to use the PrintProcessReport report option to invoke a single report at the conclusion of batch processing the the formula {SO_VInv.InvRunNo} is set by us to be that of the RunNo generated and set for each SO_History.RunNo.

I've also added improvement DEV-8119 to expose the RunNo as a property you can examine after processing to make this all much easier.

Re: Sales Order Processing Screen

PostPosted: Fri Feb 28, 2020 5:42 pm
by SBarnes
I forgot you can't get the process number, the change will definitely make things easier

Re: Sales Order Processing Screen

PostPosted: Fri Feb 28, 2020 8:02 pm
by Mike.Sheen
SBarnes wrote:I forgot you can't get the process number, the change will definitely make things easier


Well, you're one ahead of me then - I didn't even know that you cannot get the RunNo, let alone have known that and then forgotten it!

Re: Sales Order Processing Screen

PostPosted: Sat Feb 29, 2020 8:49 am
by SBarnes
I discovered it when I was trying to do the contortion of splitting the sales order into multiple debtor transactions on the sales order processing but then you generously provided the event that allowed that to happen, sorry for not letting you know as I assumed it was that way for a reason.

Re: Sales Order Processing Screen

PostPosted: Sat Feb 29, 2020 12:21 pm
by pricerc
Mike.Sheen wrote:
pricerc wrote:Ok, so related question.

I've processed a bunch of orders through this screen.

If I want to go and print them through batch printing, is there a clever way of identifying the ones I've just processed?


Add a handler to the OnProcessStart and OnProcessEnd events, and in the OnProcessStart handler, add a handler for the Removed event of the ProcessCandidates collection - the removed event gets raised after successful processing of each sales order. And in that Removed handler, you can add to your own list of what was processed.

Then, in the OnProcessEnd handler, remove your handler for the ProcessCandidates.Removed, and then you can do your printing.

If you wanted to invoke just one report with all sales orders identified as being in the batch just processed, then you can use the SO_History.RunNo of anything in your collection to find cohorts. The other option is to use the PrintProcessReport report option to invoke a single report at the conclusion of batch processing the the formula {SO_VInv.InvRunNo} is set by us to be that of the RunNo generated and set for each SO_History.RunNo.


Thanks Mike,

At least I know what I'll be doing on Monday.