Custom Button Actions
Reveal the actions drawer by clicking the gear icon in the lower right of an item's popover. You can add as many custom actions as you'd like: your list of actions will scroll if it exceeds the length of the drawer. (Note that you can add custom actions to your Google Calendar sources as well as to your different Salesforce objects. And you can now add custom actions to shared calendars!)
In this article
How to create your own buttons
Creating a new action is pretty easy:
- 1
- Log in to admin settings and select the source you're interested in.
- 2
- Scroll down past the Source Settings and Field Mapping, past Event Actions, until you see "Custom Actions"
- 3
- Click "Add New Custom Action" and give your action a name.
- 4
- Paste the code you'd like to execute where it says "URL or Function". This is obviously the interesting part--writing the action itself. Don't hesitate to get in touch and ask for help.
- 5
- That's it.
- Here's an example that marks a Campaign as "Active" from within DayBack Calendar. You can download the action code here: makeActive.js This video shows you how to apply the code to your custom action button and then modify it as needed:
-
Button action scripts you can start using right away
Here are some examples you can use as the starting point for your own buttons.
Schedule GoToMeeting or Zoom Meetings from within DayBack Calendar
Slack WebHook (Send A Message To Slack)
Harvest Time Tracker Widget
Parse And Open URL In Event
Track UPS Package
Compose an email with the event title, description, and a link to the event. emailSupport.js
This custom function takes advantage of the seedcodeCalendar.get(filterType) function to create a URL that can be shared with DayBack users within your organization. This link will take them right to the same view, with the same filters applied to the calendar, and even open the same event you have open: CreateInternalURL.js
Open a rich text editor to modify an event
There are two actions in here. injectTinyMCE.js is a Before Calendar Rendered app action that adds the TinyMCE library to DayBack when you first open the calendar. richTextEditor.js is the button action that opens a new popover with the rich text editor for you to modify your field.
Buttons to Call Scripts in FileMaker
Styling your action buttons with colors and icons
Tag your button with a class. When you describe your custom action button in source settings you'll see a place to give the button a class name. Note that you can tag a button with more than one class by separating your class names with a space:
.SomeClassName .btn { background-color: blue; } .SomeClassName .btn:hover { background-color: gray; } .SomeClassName .btn:active { background-color: black; } .SomeClassName .btn::before { content: "\f00c"; font-family: FontAwesome; padding-right: 5px; }
More resources for custom actions
Learn more about data tokens, event attributes, and the functions available to your custom actions here: APIs: Resources for Custom and Event Actions. Learn about the JavaScript objects and methods you can take advantage of here: Objects and Methods for Custom Actions.
Actions also make a great sandbox for trying out new code and testing queries. Here's an example of how DayBack's Jason Young uses Custom Actions to console log query results: Testing SOQL Queries in DayBack Calendar