Refreshing the Calendar


When does the calendar refresh?

When Editing Events or Navigating

When you click on an event in DayBack, the event's details are displayed in a popover. If you modify the record and close the popover, DayBack will refresh that event. However, the calendar will not automatically search for other events created by other users.

This means that edits and new event records created by other users won't automatically appear on your display without your interaction. Generally, this isn't an issue because the calendar requests new events from the server each time you:

  • Navigate from day to day
  • Apply resource filters
  • Switch views (e.g., from month view to day view)

However, if you are just looking at your screen, you may want to manually refresh to ensure you have the latest data from the server.

Refreshing Manually

Click the refresh button below the date in the calendar's header, as in the screenshot below.


You might want to consider installing our popular keyboard shortcuts extension, which installs a refresh calendar keyboard shortcut.

Alternatively, right-click anywhere in the calendar's display, select the "Reload" option, and DayBack will refresh the display and fetch any events that may have been created by other users.

Refreshing using a URL or Custom Action

You can refresh the calendar from your own code by using the DayBack URL parameterrefresh=true or by using this method in your JavaScript custom action

seedcodeCalendar.get('element').fullCalendar('refetchEvents');

Enable Auto-Refresh with Kiosk Mode

You can also put the calendar into auto-refresh mode by using the kiosk URL parameter, and specifying a refresh time in minutes. For example, if you wish the calendar to refresh automatically every 10 minutes, set the kiosk URL parameter to 10 . Here is the a full URL example:

https://app.dayback.com/?kiosk=10#/

This feature  can also be enabled in an app action using the startKioskMode function.


Refreshing a Found Set of Events in FileMaker

While it's possible to refresh the entire calendar using a URL parameter or a Custom Action, as described above, you may prefer to refresh only specific events. A common modification involves updating multiple related events when one event is changed. For example, if an event linked to a project is pushed out by a day, all downstream events related to that project are also shifted by a day. Here’s how you can reflect these changes in DayBack without performing a full refresh.

Using the Update Script

SeedCode provides an update file containing two scripts that you can copy and paste into your existing file or a stock copy of DayBack:

  1. Update Events On Calendar - DayBack: This script sends all your FileMaker-side edits to DayBack.
  2. Bump Not Started - DayBack: This example script demonstrates how to call the Update Events On Calendar - DayBack script.

Script Requirements and Usage

The Update Events On Calendar - DayBack script does not require modification. It should be called as a sub-script with a parameter formatted as a list of the values returned by the DBK_JSON field you've added to all your calendar sources. Ensure the DayBack web viewer is in focus so it can receive the payload of events. If you are in a found set, use the value returned by the DBK_JSON_ListOf summary field.

Simple Example Script

Here’s a basic script example to cancel all your events for today:

#cancel all my events today
New Window [ Style: Document; Name: Get ( ScriptName ); Using layout: “Sample Events” (SampleEvents_DayBack); Close: Yes; Minimize: Yes; Maximize: Yes; Resize: Yes; Menu Bar: Yes; Dim parent window: No; Toolbars: Yes ]

Set Error Capture [ On ]
Enter Find Mode [ ]
Set Field [ SampleEvents_DayBack::Resource; Get ( AccountName ) ] 
Set Field [ SampleEvents_DayBack::DateStart; Get ( CurrentDate ) ] 
Perform Find [ ]
If [ not Get ( LastError ) ]
	Replace Field Contents [ SampleEvents_DayBack::Status; Replace with calculation: "Canceled" ]
	Sort Records [ Restore; No dialog ]
	Set Variable [ $eventsToUpdate; Value:SampleEvents_DayBack::DBk_JSON_ListOf ] 
End If
Close Window [ Name: Get ( ScriptName); Current file ] 

#update events in DayBack
Perform Script [ “Update Events On Calendar - DayBack”; Parameter: $eventsToUpdate ]

Updating Shares

In addition to updating the view in DayBack, the script also allows you to update and delete existing events on Shares that contain the specified events, even if those events are not in the current view.

Updating Your Existing File

Download the DayBack Scripts-Refresh Events.zip file and copy the following scripts from the example into your current file:

  • Update Events On Calendar - DayBack
  • Bump Not Started - DayBack

Please update the BuildNumberCalc field in the DayBackHelper table to keep track of your changes.

The Bump Not Started - DayBack script is not required, but it’s recommended to download this script to get you started with this new feature.