Page 1 of 1

Duplicating a tab to a new tab

PostPosted: Wed Mar 17, 2021 6:09 pm
by DannyC
Gday,

Just looking at Inventory, Alternate - Children.
I have a client which could make good use of the identical layout of that tab, they'd call it "Related products". It wouldn't need to have any logic behind it i.e. I know that when items are added to Alternate Children the sales order entry can can use that to find other items when the selected item is discontinued etc.

In their case, it would just be a place they can list similar/like items.

How could I duplicate that tab inside the Inventory, Alternate tab? I assume I'd need to have some custom SQL table(s) too, let's call it IN_Related.

Re: Duplicating a tab to a new tab  Topic is solved

PostPosted: Wed Mar 17, 2021 6:14 pm
by Mike.Sheen
DannyC wrote:How could I duplicate that tab inside the Inventory, Alternate tab? I assume I'd need to have some custom SQL table(s) too, let's call it IN_Related.


Yeah, that's a lot to cover in a forum post - but yes you'd need a table to store the data, a plugin with some classes to read and save the data to the table - some hooks into the business logic SaveStart or SaveEnding and the ReadEnd, and some form plugin code to add the tab and grid and hooks in various places to populate it.

If the customer requirements are as straightforward as you say, then I'd estimate if I were to be tasked with it, I'd want 6 to 8 hours of time. We've done very similar things before, and that's roughly what it took.

Re: Duplicating a tab to a new tab

PostPosted: Wed Mar 17, 2021 6:53 pm
by DannyC
if I were to be tasked with it, I'd want 6 to 8 hours of time


I'd multiply that by 10 if I were tasked!
I'll keep it in mind. The client might be OK to proceed with that.

Re: Duplicating a tab to a new tab

PostPosted: Thu Mar 18, 2021 1:15 pm
by SBarnes
I've done this before with inventory, inventory classification and debtors, the best way to do it is roll your own Jiwa Collection Item class as a row of the table and then roll you own Jiwa Collection to do the rows.

Then stick the collection in the business objects generic collection and pull it out on the events when you need it.

The only other trick is have a cascading delete on your table so you don't blow Jiwa up with foreign keys when it tries to delete an inventory item and doesn't know about your extra table.

I would agree with Mike's estimate on the time that may be greater however depending on the complexity of the table and Jiwa grid you need to implement but doing a tab isn't really any different than doing a screen from scratch.