
Part 2 of 3 on creating attendees, invitations, and accepting invitations in DayBack.
In Salesforce, the standard Event object supports a single owner by default. In DayBack, it’s typical to map the owner of the standard Event as the resource so individuals in the organization have their own row or column in DayBack’s resource scheduling grids. Resources can also be organized into groups or folders to easily isolate a group’s schedule. However, it’s common for organizations to want the ability to associate an event with multiple people or resources.
One way to accomplish this is to use the standard Event’s Attendee field. This field is a look-up that links multiple Users and Contacts to an Event. The Attendees field can be used whether Salesforce’s Shared Activities are enabled or disabled and the behavior differences between these two settings will be examined more closely below.
Need help? The instructions and example code that follows is designed to show you how this customization works and to let developers add this to their own deployments. If you’d rather we deploy this for you, we can customize this feature and add it to your DayBack as part of an implementation package. Just get in touch.
In Salesforce classic the Attendees were called Invitees and the same object EventRelation handles this data in both classic and Lightning, so the techniques described here work in both environments. The Attendees field also supports a single Lead, but the Event can either have one Lead as an Attendee or up to 50 Contacts. This post is just going to look at working with Users and Contacts.
By default, the Attendees field is not part of the standard Event layouts, so it will need to be added to a layout for users to populate in the native Lightning layout:


Multiple Attendees in DayBack
DayBack’s standard popover lets you link a single user as the Event’s resource when the resource is mapped to the owner (to Owner.Name). To enable the multi-person look-up available in Lightning layouts, we’re going to turn to a Custom Button Action to expose a DayBack modal dialog for doing the look-ups and then update the Salesforce based on the results of the dialog.

Attendees added in DayBack show up as the Attendees on the native Lightning page and visa-versa.

Attendees who are Salesforce Users get a Read-Only Copy of the Event
When a Salesforce User is added as an Event’s Attendee, a new read-only copy of the original Event is created on their calendar automatically. This reflects in DayBack with an Event in each resource’s column.

If any Attendee besides the Owner/Organizer tries to edit their copy of the Event, they will get a Salesforce error that’s displayed in DayBack.

Linking Contacts to Shared Activities
Up to 50 Contacts (or one Lead) can be added as Attendees to an Event. These Contacts are stored in the Attendees field, but this does not automatically make them related Contacts to the Event as stored in the Name field. (In order for the event to show up in the Contact’s Activity feed they must be related through the Name field.) For multiple Contacts to be stored in the Name field, Shared Activities must be enabled for the org. Additionally, there is a separate setting that automatically relates Contact-Attendees to the Event. This feature works in the native Lighting editing modal dialog, but we can specify a setting in the Custom Button Action to achieve the same thing from DayBack.



Add this to Your DayBack: Configuring the Custom Button Action
To get this working in DayBack, you’ll create a single Button Action in the calendar you’ve mapped to Events. The Button Action has two variables you’ll configure at the top of the code, the rest doesn’t need to be changed. One variable specifies whether the org has Shared Activities Enabled and the other is variable adds your attendees as related Contacts to the events like the Auto Relate feature does in Lighting. By default, both these variables–sharedActivities and addAsName–are set to false so you’ll need to update those for your org accordingly. Here’s the sample code for adding the Custom Button Action to your calendar:
If you haen’t added a button to DayBack befoe, you’ll find instructions here: Custom Button Actions.
Sending Notifications to Attendees
At this point, (Fall, 2020) email notifications to Attendees are not supported in the Lightning Experience. Additionally, there is no native way to accept an invitation as a User in Lightning. Users can delete their copy of the Event in Lightning and this will update their Attendee status as declined, but that’s all you have when it comes to a user-confirmation flow. If you want to send notifications from Salesforce directly or accept an event within Salesforce, you’ll need to jump back to Salesforce Classic to do this. From Lightning itself, it looks like the only option will be using a sync option with Microsoft Exchange or Google Calendar and have those platforms manage the actual invitations and sync the status back to Salesforce. This had been handled with Lightning Sync, but that’s being discontinued for new customers to be replaced by Einstein Activity Capture. You can read more about this from Salesforce here.
Using Google for Notifications from DayBack
Since Lightning is moving to a sync approach for email notifications anyway, doing this sync directly in DayBack may provide the best user experience since DayBack handles this very smoothly. In a previous post we looked at using Google calendar to send notifications and that would also be a great solution for sending notifications to your Salesforce Attendees. Our next post will look at combining these techniques to get a full notification and acceptance flow from the Attendees starting with a Salesforce Event.
Even when attende accepted the event why the question is still visible on the page.
It is visible as ?Shivani
Hi Shivani, Not exactly sure why that ? is still there. But sounds like the action in DayBack that is polling for the users acceptance in Google is still finding the event unaccepted, even though you accepted it manually in Salesforce. I saw that you emailed us about this as well so I’ll ask the team to send some suggestions via email. Thanks!