Page 1 of 1

Optional lookup for System Setting

PostPosted: Wed May 04, 2022 4:42 pm
by pricerc
I'm adding a C/C surcharge function to my Stripe plugin.

I'm adding a setting for Stocked vs. Non-stocked for the surcharge item.

And another setting for the part number. (And probably another for the description.)

If they choose "stocked", I'd like the part number field to be a lookup. If they choose "non-stocked", then it should be a plain text field. In either case, I plan to store the part number (not the inventory ID).

And it should always work like the PartNo field in sales order maintenance, where you can type a part number and it will validate it when you {tab} away.

I'm figuring that I'm best to make the field a text rather than lookup field, and then if necessary, replace the editor in the FormatCell function of SystemSettings class in my plugin.

Any pointers ?

Re: Optional lookup for System Setting  Topic is solved

PostPosted: Wed May 04, 2022 5:09 pm
by SBarnes
Why wouldn't you just make it a lookup field and just unlock cell beside the button if necessary and capture the text change by attaching a change event to the grid or if you want to make it simple and go around the problem based on the other setting when the button is pressed either show a Jiwa search screen or the standard windows input box to get the text from the user?

Re: Optional lookup for System Setting

PostPosted: Wed May 04, 2022 5:45 pm
by pricerc
SBarnes wrote:Why wouldn't you just make it a lookup field and just unlock cell beside the button if necessary and capture the text change by attaching a change event to the grid or if you want to make it simple and go around the problem based on the other setting when the button is pressed either show a Jiwa search screen or the standard windows input box to get the text from the user?


I guess I'm expecting the default/common case to be that it's a non-stock item being used, so I'm thinking about it from that angle.