Mapping the Resource Field in Salesforce

Overview

Resource scheduling is one of the real strengths of DayBack calendar, and I'd encourage you to check out some of the resource scheduling views here:  Resource Scheduling

As part of setting up your calendar, you'll tell DayBack which field holds the data for your resources. This article The rest of this article describes which kinds of fields you can use for resources.

In this article


What is a resource?

A "resource" is anything in your org that can get overscheduled: a room, a person, a team, or even a business process. The resource views give you a dedicated row or column for each resource so that you can easily see which are overscheduled, which have gaps, and drag events from one resource to another.

In field mapping, you'd select the field in your event or appointment object containing your resource. For example, in the native Event object, the resource is usually a person, and the field is usually Owner.Name. In a custom object, you may have created a field for the truck or technician that's your resource.

The rest of this article describes which kinds of fields you can use for resources on the "Resources" tab of field mapping. Each kind of field has its own advantages and disadvantages.

Note: In addition to field mapping, you'll also add resources to DayBack's left-hand sidebar so that you can filter the calendar by resource and group your resources into folders by skill or location. You'll find information on how to do that here: Adding, Removing, and Sorting Resources.


Owner.Name - the default for Events, Tasks, and Campaigns

By default, DayBack maps resources to the Owner.Name field in your Event and Task objects. This works great for many applications.

There are some downsides to using owner (maybe these are downsides to using Events, and some Salesforce developers will decide to use a custom object instead). Salesforce doesn't permit multiple values for owner, you can't have multiple values here, and you can't leave the owner blank (or drag an event to the "none" column in DayBack).

Since you can't have multiple values in an owner, you can create multiple instances of the same event instead: control-drag or option-drag an event to a new resource to quickly create a copy of the event. 

To use Owner.Name,  leave the switch for "My Resource is a Related Field" set to "no" and select "Owner.Name" from the drop down list of available fields.

Note: DayBack will clear out your resource selection whenever you toggle the switch for "My Resource is a Related Field" so please double-check that you have selected a field there.


Text fields and multi-selection picklists - supporting multiple values 

You can map the resource field to a long text field or to a multiple-selection picklist. This is the most flexible option as it allows multiple resources for the same event without triggers or other customizations. This is a great option when you're mocking up a new calendar to play around with DayBack.

For text fields, you'll leave the switch for "My Resource is a Related Field" set to "no."

Lookups and related records - my resource is a related field

If your resource is a related record, you'll flip the switch for "My Resource is a Related Field" set to "yes," revealing additional options.

Displaying Resources

These options let you describe the relationship you'd like to use for your resource. In the example above, our appointment is related to a custom object for our "contractor.
Resource ID Field Name - Here, you'll see a list of relationship IDs from your appointments object. If you don't see an ID here, it's because you don't have a relationship between this calendar's object and the object you're interested in.

Resource Name Field - DayBack will fill in the Name field of your object by default. But you can change this to another field in the object if you'd prefer. For example, you may create a formula field that combines the contractor's name and specialty: you could show that instead of the contractor's name. Note that if you change or create fields in other Salesforce screens while you have this field mapping screen open, you can click the button "Refresh Drop-Down Options" at the top of the screen to get access to newly created fields.

Label - Enter the text you'd to see to the left of the resource name in DayBack's popover when you click on an event in the calendar.

Searching for and Selecting Resources

Scroll down on the resources tab and you'll see a section for "Searching for and Selecting Resources." DayBack" completes this section for you as soon as you select a Resource ID Field Name above.

The only changes you may want to make here involve the "search field" and "display field" -- leave the other options alone.

Search Field - Often, you'll assign resources to an event by dragging an event into a resource's row or column. Or you may create the event in that resource's column to begin with. But you can also select a resource by clicking on the resource in DayBack's popover and choosing a resource from the list. There is a search bar at the top of the list and the "search field" in this section determines which field you're searching on when you type something into that search bar. You'll almost always want this to be the resource's name. But you may want to search on a formula field. For example, you could create a formula field that only returns the resource's name if they are an "active" contractor.

Display Field - The display field will also almost always be "Name," but you may want to use a formula field here too. This is the field that shows up in the grey search drawer above: it's the "result" of your search.

Mapping to a formula field

DayBack can use formula fields for resources. This can be one way to use two different fields as a resource (People and Rooms, for example), though there are other ways to do this. To use a formula field, you'll need to add an action to DayBack and possibly create a trigger in order to support changing the resource by dragging events in the calendar. Here's how...
Create a Formula Field
First, create a formula field in your object. The formula will return the name of the resource as text, like "Exam Room 1" without the quotes. At this point you should see your events listed under the correct resource when you filter the calendar for "Exam Room 1". But you won't be able to drag an event to a new resource in DayBack--not yet--because DayBack would be trying to edit your formula field.
So you'll create a  Before Event Save action to telling DayBack to edit the actual Resource ID, instead of your formula field. You'll find an example of an event action like this here: Looking Up A Resource Id By Name
And if actions like this seem like too much to write on your own. we're happy to help. Just get in touch.  
Using Triggers 
You can use a trigger to get the same effect. You'd set up a new text field for the resource name and then map to that in DayBack. Next, create a trigger to look up the Id for the related record and assign that to the look-up key in your record. You'd then add a workflow rule to the key, so if it's changed outside of DayBack, the new text field also gets set up accordingly.
Here's a blog post we did that has some examples of using a trigger. We set the trigger to (beforeinsert, beforeupdate) and branched accordingly:  https://dayback.com/integrating-dayback-taskfeed-salesforce/