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:
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:
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:
Here's an example of a possible script step:
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: