DayBack offers inbound and outbound APIs.


Inbound APIs let you do things like make buttons in your other Salesforce pages that control behaviors in DayBack. These buttons manipulate DayBack's url and can do thinks like navigate to DayBack and show a specific event, or navigate to a specific view in DayBack and filter for a specific campaign. Learn more about  adding DayBack buttons to your layouts.


Outbound APIs (webhooks) let you run you own scripts from within DayBack or jump outside of DayBack to call routines in other applications. Most outbound calls are trigged by a "custom action"--a button you add to an item's detail drawer in DayBack. 

You can also trigger calls from events that are already happening within the calendar--things like editing, creating, or deleting event can be configured to call actions without the user needing to click a button: we call these "event actions".

  Learn more about custom actions or about event actions and then return here to learn more about the javascript libraries and data tokens available to your actions.    

What kind of JavaScript can I use in custom/event actions?

Most everything. We don't allow access to the global window object but all built-in functions for window can still be called directly. For example: open(), close(), alert(), location.href, can all be used as long as you don't use them in the context of window. In other words, use location.href instead of window.location.href.

For working with Salesforce data, you can use  Canvas JavaScript SDK, a powerful library that includes its own ajax function you can use right to make REST calls to Salesforce right from DayBack. To facilitate this, DayBack provides two functions for retrieving the Client and Context object for returning those objects respectively. 

  • fbk.client()
  • fbk.context()

The Client object is used for authenticating your ajax calls and the Context object contains metadata about the current user, their org and current urls for making REST calls. Please refer to the Canvas JavaScript  SDK Function Reference for more details and examples.

For examples of using fbk.client() and fbk.context() in a DayBack custom action, see the "Create a New Salesforce Record from a Google Calendar Event" example here: Google Calendar Actions in Salesforce.

DayBack also includes a few popular libraries to make coding easier. jQuery, BootStrap, and moment.js are all included. So anything you can do in one of those libraries can be used in a custom action.

Keep in mind when writing Javascript for custom actions that the code is executed when loaded (it's loaded when the button to run the action is clicked). So things like onload or jQuery $.ready() aren't necessary here.

Using data tokens in Salesforce and FileMaker

DayBack gives you the ability to specify data tokens that will be replaced by event data at the time the custom action is run. This is useful for passing event data to other services for example.

All data tokens are wrapped in double brackets with the mapped field name [[DataToken]]. For example, if you wanted to reference the ID field as it is mapped by default it would look like this [[Id]]. Data tokens use the names that you assigned when you mapped your fields in the source settings (your field names).

An example URL using data tokens might look like:  http://www.somewebsite.com?id=[[Id]]&date=[[StartDateTime]]

If you are using data tokens in Javascript code we recommend wrapping the token in quotes so if the value is empty it doesn't throw an error in your javascript code. All data tokens are strings this way which makes coding more consistent.

An example here might be: var eventID = [[Id]]; alert(eventID);

Even with boolean values like allDay the preferred method here is to use a string for example: var isAllDay = "[[IsAllDayEvent]]" === "true"; //Evaluates to a boolean

Using data tokens with Google Calendar

Since there is no field mapping required for Google Calendar sources (DayBack knows how to find the data it needs in Google) you'll use DayBack's own name for each data object when writing custom actions for your Google events. Here are the names of each of the properties you can reference in a custom action for a Google Calendar event:


Still need help? Message Us Message Us