Just a one step script, attached to an OnObjectModify script trigger may do the trick:
Refresh Window [flush cashed join results]
You could try it manually from the Records Menu at the top. Change your field, then go Records>Refresh Window. If it works there it will work as a one line script
Sweeeet, thanks Steve.
Applied it to the radio selector and it works like a dream :)
You can change the field's storage options so that it is not global and just be sure to commit records after each change of the field's value. Note that the OnObjectModify trigger can be set up on your radio button formatted field to either Refresh [flush] or commit records.
But If you want to keep the field as a global field, you can modify your relationship to be:
LayoutTable::globalRadioButtonField X PortalTable::Year AND
//put your current match fields here...
You can double click the relationship line to open up a dialog where you can add more match field pairs like this and to specify a different operator than the default = operator.
By including the match field in the relationship but with the X operator, the portal will update without needed Refresh Window [Flush Cached Join Results]--which can really slow things down in cases where there are a lot of records involved.
So here's the kicker!
I'm intending the portal to be used to add info as well as display it. Normally you'd just click the empty line at the bottom and add a new row.
In this case, it's filtered by year. What would be really clever would be for the year field (which is shown on the portal row) to auto populate when a new record is created.
Would this be a case of script triggering from the portal (OnObjectModify) to a script which adds the GL_Year variable to a new record on the portal table? Or is there a much more elegant/uncomplicated way to do this?
You can set up auto-enter options (calculation) to copy the contents of the global field into the new portal record's corresponding year field.
That's great, always wondered how that works. One subtle behaviour change is the filter now does not change when you click a different year radio button UNLESS you click out of the portal and then click the new year. It's almost as if you either need to remove the focus from the portal or reset the global variable?
What you are doing commits the record change. I did suggest that you use a script trigger to commit records everytime you modify the radio button field.
But why would the radio button field be INSIDE the portal?
The radio field is outside the portal, I think my grammar is to blame here!
I also had the refresh but not the commit, thanks :)
Hello. I'm trying to do something similar and tried to apply this suggestion and it still does not update the filter. I have set my relationship as follows:
(Global field) MainMenu::Filter X Reports::Filter (calculation field) AND
(Global field) MainMenu::Name = Reports::Therapist (Text Field)
I've tried changing the relationship operators between X and = with no effect. When I don't set the menu fields as globals the filter works fine without the filter relationship. But I really would like to keep them as global to prevent having to make some other changes if I don't.
If I understand your response correctly, I do not have to use refresh / committ as a script trigger if I use the relationships? Correct?
Either way, it's not working when I change the radio button filter field on the menu.