tabless panel shows dataset from other main form

I have two main forms.
One is based on table company and shows the different tabs based on a relation to company_to_products. When I browse through the different tabs all works fine.
The other main form is based on the table products and shows a couple of tabs that shows the same forms as the other main form (these forms are based on the table products as well).

Somehow when I browse the different tabs sometimes the forms in the tabless panel shows the dataset that belongs to the company_to_products form.
I guess that i have to specify a foundset when I switch the different tabs.

At the moment I use:

{
globals.dp02_tabmainformname = elements.dp_02_Tab01.getTabFormNameAt(1)
	elements.dp02_lbl_Katalog1.bgcolor = '#cbdef9'
	
	if(elements.dp_02_Tab01.tabIndex != 6)
	{
		elements.dp_02_Tab01.tabIndex = 6
		globals.dp02_tabmainformname = elements.dp_02_Tab01.getTabFormNameAt(6)
		elements.tabs_70.visible = true
		forms.controller2.elements.dp_but_nav_delds.visible = true;
		forms.controller2.elements.dp_but_nav_firstds.visible = true;
		forms.controller2.elements.dp_but_nav_lastds.visible = true;
		forms.controller2.elements.dp_but_nav_newds.visible = true;
		forms.controller2.elements.dp_but_nav_nextds.visible = true;
		forms.controller2.elements.dp_but_nav_prevds.visible = true;

	}
	}

Funny thing is that only tabIndex = 4 and 6 is sometimes not working and I use exactly the same methods.
When I use a different form for the same tab for the different main forms it works as well but then I have to update 2 forms instead of one if I need to change anything.
Any hints?
Oliver

It depends on how you added the form to the tabpanel when you designed it.
If you add a form to the tabpanel using a relation the foudnset will always be correct (even you you use the same form multiple times in multiple places) if instead you added the form to the tabpanel as unrelated then it up to you to control that the form will load the correct foundset.
Keep in mind that unless you check the “UseSeparateFoundset” property of a form that form (when shown as unrelated) will share the same foundset with all the forms based on the same table.

Thanks,
I am currently using Servoy 3.5.8 and I can not find “UseSeparateFoundset” as a property of my main form.

If i understand you correctly I have to use a self-relation products_to_products and add the forms to the tabpanel using that relation.
I will try that.

Oliver

Hi Oliver,

bender42:
I am currently using Servoy 3.5.8 and I can not find “UseSeparateFoundset” as a property of my main form.

In the menubar select the ‘Advanced filter’ under the View menu. Then you will see this form property.

Hope this helps.

ok,
found it.

Using a self-join did the trick for me.

Thanks