Page 1 of 1

ForceInventorySelection except in sales orders

PostPosted: Thu Feb 11, 2021 12:43 pm
by DannyC
Hi,

I have a client who wants incoming SOH to force users to select bins for putting away/saving so the system setting ForceInventorySelection is ticked.
So GRNS, bookins etc will pop up the serial/bin selection box. All good.

But when adding lines to a sales order, they don't want the serial selection box popping up. Actually it only pops up if the bin <> default bin but for this discussion it's irrelevant (I think).

I've tried doing a plugin on form SetupBeforeHandlers for
salesOrderForm.SalesOrder.SalesOrderLines.Adding
salesOrderForm.SalesOrder.SalesOrderLineAdding
salesOrderForm.SalesOrder.LineDetailAdding

and setting the ForceInventorySelection = false

but none of those 3 events seem to be the right one.

What's the trick to getting Jiwa to stop the serial selection box popping up just for sales orders but leaving it ticked for GRNS and bookins?

Re: ForceInventorySelection except in sales orders

PostPosted: Thu Feb 11, 2021 4:49 pm
by Mike.Sheen
DannyC wrote:Hi,

I have a client who wants incoming SOH to force users to select bins for putting away/saving so the system setting ForceInventorySelection is ticked.
So GRNS, bookins etc will pop up the serial/bin selection box. All good.

But when adding lines to a sales order, they don't want the serial selection box popping up. Actually it only pops up if the bin <> default bin but for this discussion it's irrelevant (I think).

I've tried doing a plugin on form SetupBeforeHandlers for
salesOrderForm.SalesOrder.SalesOrderLines.Adding
salesOrderForm.SalesOrder.SalesOrderLineAdding
salesOrderForm.SalesOrder.LineDetailAdding

and setting the ForceInventorySelection = false

but none of those 3 events seem to be the right one.

What's the trick to getting Jiwa to stop the serial selection box popping up just for sales orders but leaving it ticked for GRNS and bookins?


Are you wanting to suppress the serial selection dialog also if the inventory item has the Use Serial No. flag on?

ForceInventorySelection is only useful when you turn it ON to force a selection dialog for all items, regardless of their Use Serial No. flag.

I think what you want to do is set the SalesOrderSerialStockSelectionType property of the sales order line to be e_SalesOrderSerialStockSelectionFIFO. Doing this in the SalesOrderLineAdded event of the SalesOrder should be all you need to do.

Re: ForceInventorySelection except in sales orders

PostPosted: Fri Feb 12, 2021 10:54 am
by DannyC
Are you wanting to suppress the serial selection dialog also if the inventory item has the Use Serial No. flag on?

If Use Serial No. flag is on, then I need the dialog to display.
It's only for non-serialised items that I want to suppress the dialog.

I'll give your suggestion a go.

EDIT: Nah, no dice. It still pops up the dialog.
Other ideas?

Re: ForceInventorySelection except in sales orders  Topic is solved

PostPosted: Tue Feb 16, 2021 1:19 pm
by Mike.Sheen
I think you're over-complicating it!

You want ForceInventorySelection to be ON for all forms except sales orders.

So a plugin to set that false for the sales order is all you need.

I tested with the attached and it works for me - in demo data I set ForceInventorySelection ON in the system settings - confirmed the serial dialog DOES display when adding a non-serial item to a sales order (part 1171) - and then import the attached and re-test and the serial dialog does not display.

Re: ForceInventorySelection except in sales orders

PostPosted: Tue Feb 16, 2021 4:08 pm
by DannyC
Tried your plugin.
Doesn't want to play in my database. I still get the serial dialog.
It leads me to believe I was already on the right track but it just doesn't work in this database (not Jiwa demo).

I tried it in a Jiwa demo database and it works OK so clearly there's something unique about this database. This client's database was recently uploaded to your FTP site last week to look at a different issue so maybe if you have a few minutes (yeah right, I get it) to try it in their database it would be interesting to see if you can get it to work.

Re: ForceInventorySelection except in sales orders

PostPosted: Fri Feb 19, 2021 11:44 am
by Mike.Sheen
DannyC wrote:This client's database was recently uploaded to your FTP site last week to look at a different issue so maybe if you have a few minutes (yeah right, I get it) to try it in their database it would be interesting to see if you can get it to work.


You're going to need to be a bit more specific in order for me to help you further... I do like a good mystery, and I like to think I have fairly good sleuthing skills - but I don't want to risk wasting my time on restoring and troubleshooting the wrong database.