ron G Posted May 5, 2012 Posted May 5, 2012 I am using FM 12 advanced. I put a button on my portal that opens a layout that allows the user to specify a Start Date and an End Date. These two values are collected as gStartDate and gEndDate (global). Then in the portal I specify that Dues::Date >= gStartDate and Dues::Date <= gEndDate. This works. But, there doesn't seem to be a way to 'unfilter' the portal via a script? ?? I tried changing gStartDate and gEndDate to "" but that just shows nothing in the portal. I tried putting '01/01/1900' as gStartDate and ''12/31/2050' in gEndDate and this works. But, I have a merge field that shows the filter dates on the portal and it looks 'goofy' to see a date range of Jan 01 1900 - Dec 31 2050. Thanks
Vaughan Posted May 5, 2012 Posted May 5, 2012 The problem is the logic you are using, not that portal filtering cannot be changed by a script. The filter expression needs to consider the condition that the start and end dates can be empty. Let( [ startdate = case( isempty( gStartDate ) ; Date( 1 ; 1 ; 1 ) ; gStartDate ) ; enddate = case( isempty( gEndDate ) ; Date( 12 ; 31 ; 4000 ) ; gEndDate ) ] ; Dues::Date >= startdate and Dues::Date <= enddate )
ron G Posted May 5, 2012 Author Posted May 5, 2012 Perfect. Thanks. What I was 'awkwardly' asking was "Is there an effective way, by script step, to check/uncheck or turn on/off portal filtering?" For example, a get(PortalFilterState) that could be toggled on/off. I coiuldn't find it. Maybe in Fm 13... ha ron
Vaughan Posted May 6, 2012 Posted May 6, 2012 You aren't "turning off" portal filtering, you are changing that records the portal allows to be visible. If you want to show all portal records then change the filter expression to 1. There is no need for a new function. I am noticing a trend of people requesting functions to do things that can already be done, or don't need doing.
Recommended Posts
This topic is 4935 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now