This topic contains 16 replies, has 2 voices, and was last updated by  admin 6 years, 10 months ago.

  • Author
    Posts
  • #74718

    vicente95650
    Participant

    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?

  • #74719

    admin
    Keymaster

    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”.

  • #74720

    vicente95650
    Participant

    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.

     

  • #74721

    admin
    Keymaster

    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

  • #74722

    vicente95650
    Participant

    never mind….

    Learned that pressing Alt key on my mac while opening the file causes filemaker to present a login prompt.

    thanks.

  • #74731

    vicente95650
    Participant

    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”?

  • #74732

    vicente95650
    Participant

    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.

  • #74733

    vicente95650
    Participant

    Please disregard, as it appears I was wrong  in my claim about the matching with value of  empty field.

  • #74734

    vicente95650
    Participant

    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?

  • #74735

    admin
    Keymaster

    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:

    GetLayoutObjectAttribute(“web_calendar”; “source”)

     

  • #74737

    vicente95650
    Participant

    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.

     

     

     

     

     

  • #74738

    vicente95650
    Participant

    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?

  • #74739

    admin
    Keymaster

    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.
  • #74741

    vicente95650
    Participant

    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.

  • #74742

    vicente95650
    Participant

    by the way I have NOT renamed my existing “web viewer” layout to “web_calendar”. I just asked if I should.

  • #74743

    vicente95650
    Participant

    I just checked and the button “Redraw” performs the script “Refresh Calendar()”.

  • #74744

    admin
    Keymaster

    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

You must be logged in to reply to this topic.