Duplicating a tab to a new tab  Topic is solved

Discussions relating to Jiwa 7 plugin development, and the Jiwa 7 API.

Duplicating a tab to a new tab

Postby DannyC » Wed Mar 17, 2021 6:09 pm

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

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

Postby Mike.Sheen » Wed Mar 17, 2021 6:14 pm

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.
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: 2583
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 807

Re: Duplicating a tab to a new tab

Postby DannyC » Wed Mar 17, 2021 6:53 pm

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

Re: Duplicating a tab to a new tab

Postby SBarnes » Thu Mar 18, 2021 1:15 pm

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.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1696
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 191


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 2 guests