help to display parent and child tab correctly in custom window from same table

140 views
Skip to first unread message

Crispian Blackbourn

unread,
Apr 21, 2023, 2:13:35 PM4/21/23
to IDempiere
Hi all,

I have a use case where I've created a window with several tabs.

The first tab (tab level 0) which we'll call 'my_table_1'
The 2nd tab and 3rd  (tab level 1 & 2 respectfully) are made up of data from the same table 'my_table_2'.

example of the table data in my_table_2

123456000000    which is a parent field

123456000001
123456000002
123456000003
123456000004 etc are the child fields.

So far I have managed to get tab level 1 to display correctly and function with the sql where field 'myfield is like '%000000''.

Similarly I've managed to get tab level 2 to display the all the correct child records with 'myfield not like '%000000'' however they are not peculiar to the parent field from my previous selection.

eg. If I had a top table field say 'X' and it had the following sub parent tabs 123456000000 and 234567000000 and say for arguments sake these both had 3 child tabs each. Despite selecting either parent tab
I still get all six child records. I'm not very familiar with the syntax of the display logic and the 'sql where' appears limited to one statement. Is there a way do overcome this without splitting the data into two tables.

Regards

Crispian 
   

zuhri...@gmail.com

unread,
Apr 21, 2023, 6:51:15 PM4/21/23
to iDempiere
how you define the different between record for parent and child tab? and how the connection between parent and child tab? you need to define the connection between the parent and child tab and you need to define what is the different the record for parent and child. this is an example.

lets use the sample like m_product. there is columns m_product_id, issummary, m_parent_product_id and type 

you can create parent tab named "Grouping Product" with where clause IsSummary='Y' and then you can create two child tab. first child named "Physical Product" and "Service Product". the first child tab has where clause isSummary='N" and type='Item' and second tab has where clause IsSummary='N' and type='Service'. dont forget to make m_parent_product_id on child tab mandatory to create link between parent and child tab.

Crispian Blackbourn

unread,
Apr 22, 2023, 11:22:42 AM4/22/23
to idem...@googlegroups.com
Hi Zuhri, 
Thanks for your help. In my scenario the difficulty is there is another tab down stream which references the parent tab. So my top tab is 'supplier' created from the supplier table. The next tab is 'parent category' which references supplier from  within the category table. The next tab 'child category' also created from the category table also references the supplier tab - I can't get it to work from the category field which ever way I've tried? Then the next tab down is product created from product table and that references the category field. Given the complexity of trying to get four tabs to work over three tables I think I'm going to have concede defeat and split the category table in to two,  a separate parent and child table and add some columns for functionality? I was trying to avoid this as the data comes from another source and I was hoping not to have to manipulate it. Thanks again and appreciate the help,  Crispian 


--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/0045bdc6-33bc-49fc-8949-f6a3eb2efc97n%40googlegroups.com.

Galih Pribadi

unread,
Jul 1, 2023, 9:39:41 PM7/1/23
to idem...@googlegroups.com
Hi, 

You can try this in Application Dictionary :
A. Top Window
A.1. Window and Tab
Tab level : 0
Table : my_table_1

B. First Tab
B.1. Window and Tab
Tab level : 1
Table : my_table_2
Link Column : my_table_1_id
Where : condition data for First Tab
B.2. Table and Column
Add column : my_table_1_id

C. Second Tab
C.1. Window and Tab
Tab level : 1
Table : my_table_2
Link Column : my_table_1_id
Where : condition data for Second Tab
C.2. Table and Column
Add column : my_table_1_id

Thanks

Reply all
Reply to author
Forward
0 new messages