This topic contains 16 replies, has 2 voices, and was last updated by admin 6 years, 10 months ago.
-
AuthorPosts
-
January 5, 2018 at 2:25 pm #74718
I am trying to filter events shown in the calendar by having the user select a value from a list of values. My intent is to use the Display Record Flag feature. Is there a way for the user to perform this selection from the calendar view?
-
January 5, 2018 at 4:34 pm #74719
Yes.
But you wouldn’t use “display records flag” for that purpose. Display record flag is a stored field in your event. So it’s useful for “pre-filtering” events that you know will never show on the calendar.
To filter the calendar specifically for individual users, or by users selecting a setting from a global field, you will alter the URL to perform the filter. You simply add to the url the field you which to filter by, and the value you expect in the field.
Server-Powered Quick Filter (URL Filtering)
See how we’ve done it in the starter file that comes with the soSIMPLE download. In that example we use scripts to set the URL. But you can also simply define the web viewer object to check your global field. For example, to only show events that are assigned to me (as entered into an event fields called “assign”), I would add to the URL: “assign=ken”.
-
January 8, 2018 at 2:45 pm #74720
I was successful in specifying filtering criteria in the URL but I would like to take a look at your starter file “soSIMPLE Calendar”. I started with the trial version and have since purchased and registered your calendar. However I do not know how to login with the Developer credentials that you sent me. It appears that I am logged in as Manager and cannot do much under that login. I am automatically logged in as Manager everytime! How do I login as Developer?
FYI The last Filemaker version I used was Filemaker 6. I browsed through my keychain and I don’t see relevant entries there.
-
January 8, 2018 at 2:56 pm #74721
There’s a re-login button on the Preferences > Calendar Options tab.
Or you can use the FileMaker method of holding the Option key (on the Mac) or the Shift key (on Windows) down while opening the file. That will force a login prompt.
Thanks
Ken
-
January 8, 2018 at 2:59 pm #74722
never mind….
Learned that pressing Alt key on my mac while opening the file causes filemaker to present a login prompt.
thanks.
-
January 15, 2018 at 2:13 pm #74731
related question.
While using the URL method of filtering events I noticed that if a field is empty the comparison (between the value in the field and the value that I specify in the filter) always matches. Do you have a recommendation on how to implement the opposite i.e. “empty field implies never match”?
-
January 15, 2018 at 2:16 pm #74732
I suppose I could always create a new field (calculated) that is never empty and that has a value that will never match but I wonder if there is a more straightforward way.
-
January 15, 2018 at 2:39 pm #74733
Please disregard, as it appears I was wrong in my claim about the matching with value of empty field.
-
January 15, 2018 at 6:54 pm #74734
But I do have a new question related to filtering…
I am filtering events using the URL. I have 3 global fields that I use to specify the desired values for corresponding n0n-global fields.
I noticed that, when I first display the calendar, I see the results of my last previous filter (the filter that I applied just before I closed Filemaker) even though the 3 global fields are empty (which should result in no filtering at all). The display is corrected once I click on the Redraw button. Is this expected behavior or am I doing something wrong?
-
January 16, 2018 at 10:37 am #74735
With server-powered calendars, the view is filtered by the URL – no matter whether you set URL by calculation or by using a script.
It sounds like your URL is filtered when you first open the calendar, and the refresh script changes the URL. The best way to check this is to see what the URL is when you first open the calendar. You can do this using this FileMaker function in your Data Viewer:
-
January 16, 2018 at 12:38 pm #74737
I remain confused on this issue. I don’t quite understand the purpose of the function you gave me, since I can see the URL explicitly in my “web viewer” layout. I don’t understand “when” that URL is actually used.
The URL in my “web viewer” layout is:
“http://mydomain.comsosimple/sosimple_cal.php?calendar=<lots of digits>”&”&EventFilterField=”&gEventFilterFieldSelect
where EventFilterField is the name of the field whose value will filter the calendar events and gEventFilterFieldSelect is the name of the global field that provides said value.
I followed your instructions (likely with misinterpretation) by creating a calculated field (named scratch) with the calculation: GetLayoutObjectAttribute(“web_calendar”;”source”).
I placed this field (scratch) in the same layout named “web viewer” on which the URL is also located. The value of scratch remains empty even after I click on Redraw. However filtering is indeed occurring correctly once I click on Redraw.
-
January 16, 2018 at 12:56 pm #74738
also… you referred to my “Date Viewer”; I assume you meant the layout (web viewer) on which I have my URL object. Am I correct?
-
January 16, 2018 at 1:03 pm #74739
Hi Vicente –
The goal is to find out what the actual URL is in your web viewer – that’s the only way to know why it’s filtering when you say it shouldn’t be filtering.
The easiest way to do that is to open the Data Viewer tool from the Tools menu (I’m assuming you’re using FileMaker Pro Advanced. If you’re not using FMP Advanced, you can do it with the calculation you’re using, but make sure you’ve selected “Do not store calculation results” from the storage options of that calculation otherwise it won’t re-calculate as the web viewer changes).
Also make sure that the web viewer object is name “web_calendar”. That’s the first parameter of this command.
- This reply was modified 6 years, 10 months ago by admin.
-
January 16, 2018 at 1:35 pm #74741
I am not using FMP Advanced. I set the options to “not store calculation results”. I now see “?” in my “scratch” field!
I am not sure if you are instructing me to rename my current layout “web viewer” (the layout that displays the calendar) to “web_calendar”.
And now when I click “Redraw” filtering is not occurring properly! I am really confused now.
-
January 16, 2018 at 1:36 pm #74742
by the way I have NOT renamed my existing “web viewer” layout to “web_calendar”. I just asked if I should.
-
January 16, 2018 at 1:41 pm #74743
I just checked and the button “Redraw” performs the script “Refresh Calendar()”.
-
January 16, 2018 at 1:42 pm #74744
I do not know what you changed regarding “Redraw” not functioning.
I do recommend FMPAdvanced if you’re doing any development with FileMaker. It adds a lot of useful tools that we rely on every day.
Every object on a FileMaker layout has an object name. If you click the object and choose “Inspector” it shows in the “name” field.
http://www.filemaker.com/help/12/fmp/html/edit_layout.10.16.html
-
AuthorPosts
You must be logged in to reply to this topic.