# Filtering records showing in a portal

**URL:** <https://forum.servoy.com/t/filtering-records-showing-in-a-portal/8944>\
**Category:** Classic Servoy\
**Created:** [March 29, 2008, 4:07am UTC](https://forum.servoy.com/t/filtering-records-showing-in-a-portal/8944 "2008-03-29T04:07:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![popdizzle](https://avatars.discourse-cdn.com/v4/letter/p/5e9695/32.png) [@popdizzle](https://forum.servoy.com/u/popdizzle)\
**Post date:** [March 29, 2008, 4:07am UTC](https://forum.servoy.com/t/filtering-records-showing-in-a-portal/8944/1 "2008-03-29T04:07:24Z")

</div>

I need some quick guidance on the best way to approach my issue. I’m not sure if I should use a portal or a tabpanel to present related records when I have to filter out some of the related records.

-I’m showing a master record from a main table on a form.  
-Then I need to display related records in a portal/panel from a join table below the master record.  
-I also need to reach thru the relation, which only gives me a product\_id, and do another join to the product table so I can display the product description.  
-I only want to display related records where fieldx \> 0. I need to filter out the related records if fieldx is 0.

I understand databases and relations pretty well. I’m just not familiar enough with Servoy to know the best approach to filter out the records in the portal. I’m also wondering if a portal isn’t the best way…if I should be using a tabpanel or something.

I’m also fuzzy on the best way to show the related records when I need to get the product description from a 3rd table. (join within a join)

Do I need to write custom SQL to get a dataset this complicated, or is there an easier way to do it with something simple in Servoy? Do I use a portal or something else?

Any guidance would be greatly appreciated. I’m just looking for strategy here, not all the code.

TIA!

---

<div class="post-metadata">

**Author:** ![ROCLASI](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/roclasi/32/4371_2.png) [@ROCLASI](https://forum.servoy.com/u/ROCLASI)\
**Post date:** [March 29, 2008, 8:20am UTC](https://forum.servoy.com/t/filtering-records-showing-in-a-portal/8944/2 "2008-03-29T08:20:10Z")

</div>

Hi Jason,

You can do all what you want with 1 global, relations and a tabpanel.

First you create a global of type Number with a default value of 1. Lets say it’s named 'minumumVal.  
Then you create the relations that go from master-child and child-product.  
On the master-child relation you add the extra join setting global.minimumVal \> fieldx.  
Then you create the child form as list/table view and place a label on there.  
In the label text you can use %%columnname%% tags.  
The fun bit is that you can use multiple relations in here as well.  
So you can use %%masterchild.childproduct.productname%%. But since we are in the child form already you only need to use the last relation (%%childproduct.productname%%).  
Make sure the checkbox ‘displayTags’ is checked.  
Now link this form to your masterform through a related tabpanel and you are set.

And because you are using a global you can set the minumum value on the fly and filter the list accordingly.

Hope this helps.

---

<div class="post-metadata">

**Author:** ![popdizzle](https://avatars.discourse-cdn.com/v4/letter/p/5e9695/32.png) [@popdizzle](https://forum.servoy.com/u/popdizzle)\
**Post date:** [March 29, 2008, 1:34pm UTC](https://forum.servoy.com/t/filtering-records-showing-in-a-portal/8944/3 "2008-03-29T13:34:32Z")

</div>

That worked beautifully! Thank you.

Next question…

This gives me a static list of records in the tabpanel that I don’t seem to be able to edit or select in any way.

I need to be able to select a row in the tabpanel list of related records and edit the price. I also need to be able to select a row and delete it.

Do I need an entirely different approach or can I extend the solution offered above?

---

<div class="post-metadata">

**Author:** ![popdizzle](https://avatars.discourse-cdn.com/v4/letter/p/5e9695/32.png) [@popdizzle](https://forum.servoy.com/u/popdizzle)\
**Post date:** [March 29, 2008, 1:46pm UTC](https://forum.servoy.com/t/filtering-records-showing-in-a-portal/8944/4 "2008-03-29T13:46:03Z")

</div>

Nevermind on that last question…

Instead of using tags (%%price%%) on the tabpanel, I put the field directly on the form. It then became editable.

In fact, I was a little surprised that if I edited the price on the form, it was actually changing the record in the database live. I was thinking I would have to initiate some sort of method to push the change.

Thanks again. This forum is quite a resource!
