Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Hi all,

I decided to try and build a simple calendar using portal filtering. I found a great article on the subject at here, and although it has been a great help, I am having trouble getting the calendar to display the date and events in all of the 42 portals (right now it just shows that information for the current month).

Below is the script they used to set the variables and I just can't seem to modify it to show the information I want.

Commit Records/Requests

Set Variable [ $start; Value:GetAsDate ( Div ( interface::firstOfMonth ; 7 ) * 7 ) ]

Set Variable [ $thisMonth; Value:Month ( interface::firstOfMonth ) ]

Set Variable [ $n; Value:0 ]

Loop

Set Variable [ $n; Value:$n + 1 ]

Exit Loop If [ $n > 42 ]

Set Variable [ $d; Value:$start + $n - 1 ]

Set Variable [ $varName; Value:"$$day" & Right ( "0" & $n ; 2 ) ]

Set Variable [ $varValue; Value:If ( Month ( $d ) = $thisMonth ; $d ; " " ) ]

Set Variable [ $varType; Value:If ( Month ( $d ) = $thisMonth ; "Date" ; "Text" ) ]

Set Variable [ $garbage; Value:Let ( [ varName = If ( Left ( $varName ; 1) ≠ "$" ; "$" ) & $varName ; varType = GetValue ( FilterValues ( "Text¶Number¶Date¶Time¶Timestamp" ; $varType ) ; 1 ) ; varValue = $varValue ; f = "Let ( ~varName~ = ~varValue~ ; \"\" )" ; fGetAs = "Let ( ~varName~ = GetAsXX ( ~varValue~ ) ; \"\" )" ; formula = If ( IsEmpty ( $varType ) ; f ; Substitute ( fGetAs ; "XX" ; $varType ) ) ] ; EvaluationError ( Evaluate ( Substitute ( formula ; [ "~varName~" ; varName ] ; [ "~varValue~" ; Quote(varValue) ] ) // close Substitute ) ) // close Evaluate ) //close Let ]

End Loop

Refresh Window [ Flush cached join results ]

I am really having a hard time parsing the script well enough to understand exactly what I need to change, so any help will be greatly appreciated.

Thanks in advance!

-V

Developers have been creating calendar interfaces with FileMaker for a while using a technique involving forty-two separate relationships and portals.

Not really:

http://fmforums.com/forum/topic/42617-basic-monthly-calendar-april-06/

  • Author

Not really:

http://fmforums.com/forum/topic/42617-basic-monthly-calendar-april-06/

True, but I thought that this was an interesting approach for making a calendar. It does use 42 portals for the layout, but it only needs one relationship between two tables: Interface and Events. Filtering is used on each portal to only show the events for that particular day. I know it only works in FM 11, but I seems like it might be a nice way to do a calendar.

If I wanted to go that route, I would use only 7 portals x 6 records. Here are some of the reasons:

• filtered portals are faster when the amount of records to process is reduced by the relationship;

* the filtering formula would be MUCH simpler;

• it's no fun setting up 42 portals, each one with its own settings.

  • Author

If I wanted to go that route, I would use only 7 portals x 6 records. Here are some of the reasons:

• filtered portals are faster when the amount of records to process is reduced by the relationship;

* the filtering formula would be MUCH simpler;

• it's no fun setting up 42 portals, each one with its own settings.

LOL, I wholeheartedly agree with the last bit, setting up the 42 portals was a real pain.

Back to my original question: I figured out that changing these two steps in the loop:

Set Variable [ $varValue; Value:If ( Month ( $d ) = $thisMonth ; $d ; " " ) ]

Set Variable [ $varType; Value:If ( Month ( $d ) = $thisMonth ; "Date" ; "Text" ) ]

to this

Set Variable [ $varValue; Value:$d ]

Set Variable [ $varType; Value:"Date" ]

would give me what I wanted, but I'm still having trouble wrapping my head around the whole "Set Variable [ $garbage; Value:Let..." part at the end.

I really don't like using things I don't understand, would anyone mind breaking it down for me?

Thanks!

Frankly, I have no idea what that script does, or why. I believe that even with 42 portals, things could be somewhat simpler - see the attached.

Note that I've only done the first and the last row before getting tired of it.

FilteredCalendar11.zip

  • Author

Frankly, I have no idea what that script does, or why. I believe that even with 42 portals, things could be somewhat simpler - see the attached.

Note that I've only done the first and the last row before getting tired of it.

I could not make much sense of that script either (it sets variables for the 42 merge fields that go along with the 42 portals). Thanks for your example, it is much easier to comprehend.

I am not sure if filtering portals is really a great way to do a calendar, but it has been an interesting experience.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.