ForceInventorySelection except in sales orders  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

ForceInventorySelection except in sales orders

Postby DannyC » Thu Feb 11, 2021 12:43 pm

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?
User avatar
DannyC
Senpai
Senpai
 
Posts: 636
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 30

Re: ForceInventorySelection except in sales orders

Postby Mike.Sheen » Thu Feb 11, 2021 4:49 pm

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.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: ForceInventorySelection except in sales orders

Postby DannyC » Fri Feb 12, 2021 10:54 am

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?
User avatar
DannyC
Senpai
Senpai
 
Posts: 636
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 30

Re: ForceInventorySelection except in sales orders  Topic is solved

Postby Mike.Sheen » Tue Feb 16, 2021 1:19 pm

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.
Attachments
Plugin ForceInventorySelection off in sales orders.xml
(27.31 KiB) Downloaded 29 times
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: ForceInventorySelection except in sales orders

Postby DannyC » Tue Feb 16, 2021 4:08 pm

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.
User avatar
DannyC
Senpai
Senpai
 
Posts: 636
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 30

Re: ForceInventorySelection except in sales orders

Postby Mike.Sheen » Fri Feb 19, 2021 11:44 am

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.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 7 guests