DayBackForFileMaker

Navigation

Can I script the calendar to go to a specific date?

Yes! Have your script set the variable $$sc_FocusDate and then head to the calendar layout. If you're already on the calendar layout, run the script "Refresh Calendar" passing the sc_FocusDate parameter to have the date variable take effect =)

If you want to go to a specific date on startup, you can specify the focus date at the end of the "Upon opening" script by setting the parameter of the Perform Script["Go To WebViewer Calendar Layout"] step. The calendar mode or view is already being set in this parameter, so you can add the focus date like this:

#("sc_Mode" ; "Month") & #("sc_FocusDate" ; Get ( CurrentDate ) - 30 )

Can I script the calendar to go to a specific calendar mode/view?

Sure thing. Like navigating to a specific date, have your script set the variable $$sc_Mode to one of the calendar modes listed here: ModesInTheCalendar. Then, simply navigate to the calendar layout. If you're already on the calendar layout, run the "Refresh Calendar" script passing the sc_Mode parameter and the calendar will change to the mode you've set.

We can set DayBack to open to a specific mode by modifying the Perform Script["Go To WebViewer Calendar Layout"] parameter at the end of the "Upon opening" script. Replace the default mode, "Month", with your preferred mode. For example, the following will open up Horizon mode by default:

#("sc_Mode" ; "Horizon")

Can I show an event on the calendar from another window

Yes. The "Show Event Details On Calendar (SourceNo ; FocusDate)" script is used by default to show a specific event on the calendar when you are within the context of the event record. This works when you are in a layout or portal based on the event table.

If you are outside of the context of the event record, you can add the lines highlighted in the screenshot below and pass the additional parameter $sc_EventID to the script:

Navigating via script when already viewing the calendar

You can refresh the calendar and pass specific parameters using the "Refresh Calendar" script to navigate to a specific date/view when the calendar is already open. This can be helpful when you have your own FileMaker objects in a nav bar on the calendar layout.

Optional parameters that can be passed into the "Refresh Calendar" script are:

  • sc_Mode
  • sc_FocusDate
  • sc_RangeDate
  • sc_ResourceDays
  • sc_ResourceColumns

Here's an example of a possible script step:

Perform Script ["Refresh Calendar"; Parameter: #("sc_Mode" ; "Resource Vert") & #("sc_FocusDate" ; Get ( CurrentDate ) - 30 ) & #("sc_ResourceDays" ; 7) & #("sc_ResourceColumns" ; 2 )]

Enjoy!

Calling "Refresh Calendar" from another file.

You can call the refresh calendar script from another file when you want to navigate to a particular view / date range. Two things to note:

1. That script parameter is formatted with a custom function, so you'll want to add the custom functions from DayBack into your file before that will work.
2. The "Refresh Calendar" script assumes you're already ON the calendar layout. So you may want to preface it with an if statement that moves you to the calendar layout if you're not already on it.
(855) SEEDCODE
[email protected]
Follow us: