You could make the relationship to the portal additionally have a global value, say, in it. Then the button could change the global value to be the filter criterion you want.
Sorbsuster I do not follow you, how could I display only some records then in the portal? Could you give some example please?
Suppose you have a two tables:
You create a relationship CustomerID -> CustomerID between those two tables. The portal of invoices drawn on the customer record would list all invoices for that customer.
- create a calculation in Invoices: InvoiceYear = Year (InvoiceDate )
- create a global number field in the Customer table, and call it gYear.
- change the relationship to have two criteria; the original one by CustomerID, and now gYear = InvoiceYear as well
- as you select a different year it should filter the invoices listed to only show that year.
That's just an example. You may have to trigger a screen refresh to force the relationship to recalculate.
It is more clear now, thanks, but why shall it be a global field?
Good point! - and in many ways it makes no difference. But it is a habit that I am in. The reason would be that it lets different users have different values of the field, at the same time. Also, when you change record it will still have the same value. But you are right - that could be either a good thing, or a bad thing, depending on how you want the user experience to look.
Either will work the same way on any one record. If you change record the filter will not be there, and it's up to you to say if that is a good thing or bad.