Understanding The Calendar Objects

  • 1
  • Question
  • Updated 4 years ago
  • Answered
I am having problems understanding how to setup the Calendar Component.

Simple Use Case:  Setup a Weekly view with available appointments.  Need the available appointments to display in an available appointment color.   The User should be able to schedule an appointment when there is an available time slot.  Scheduled time slots should change to scheduled color.

I am using the Event object.
I am having problems understanding how to setup the model(s).

Questions:
* Should I create a separate Object for the Available Appointments?
* There seems to be many different models I need to setup.  For example: Valid Date Range Model, Event Source Model, Week View Group Model... [[ are all of these models suppose to be different objects.  Not sure what they all mean.]]

I've read the Calendar tutorials already, it helped, but I think I need to understand the questions above in order to implement what is needed.

Thank you in advance.
Photo of Sofware Developer Guy

Sofware Developer Guy

  • 1,354 Points 1k badge 2x thumb

Posted 4 years ago

  • 1
Photo of Emily Davis

Emily Davis, Employee

  • 3,502 Points 3k badge 2x thumb
Most likely, you are working with one object (the Event object), unless you want to use some custom objects you've created as well. Your calendar can display as many event sources as you want, and each of these event sources is related to a different model. These different models can all be on the Event object, but they may have different conditions to display different kinds of events for different event sources. For example, you may want a model "MyEvents", containing only events where "Assigned To" is the user viewing the page. In your case, I'm guessing "Available Appointments" is dependent on a certain field? In this case, you may want to have two event sources, one for "All Appointments" and one for "Available Appointments," where the Available Appointments model has a condition on the field(s) determining whether this appointment is available or not.

As to things like Week View Group Model, I don' t know if you actually need a model for this. The week, day, and month views come built-in with Skuid. So when you add a view to your calendar, everything should already be set up to view your event sources in that view.

If you choose to use grouping (for example, in the week view), you will probably need a separate model for this. Admittedly, this can be confusing. My example was grouping by the user that an event was assigned to. I made a separate model on Users, then I can set conditions on this model if I only want to pull in certain users. After making this model, you have to be sure to do several things:

1) Include a grouping field in your event model  (in my case, OwnerId, which points to a user).

2) Set the Grouping Field on the Event Source.


3) On the week or day scheduling view, set the Grouping Model and field(s) from the grouping model that you want to display in these column labels (in my case, I want Name of each user to display in the calendar).


I hope isn't just what you got from the tutorial. Let me know if all this makes sense!
Photo of Sofware Developer Guy

Sofware Developer Guy

  • 1,354 Points 1k badge 2x thumb
Yes.  Thank you for your help.  Your post is guiding me in the right direction.

I Understand the filtering on Event based on some field to have an Available and Scheduled Appointments list.  Thank you.

On another note:  what is this model supposed to do: (Valid Date Range Model).


Thank you.
Photo of Sofware Developer Guy

Sofware Developer Guy

  • 1,354 Points 1k badge 2x thumb
Just wanted to share some progress that works for the lanes.

For defining the lanes:



Used a Custom Settings instead of an object:
Photo of Emily Davis

Emily Davis, Employee

  • 3,502 Points 3k badge 2x thumb
I see that Ben started working with you on your other post? I think you are right that Salesforce does not allow you to create custom lookup fields on the Activity object... yuck! I found a post about it here. Looks like they are taking the idea into consideration! For now, your best option would be either to use the standard lookup fields under "Event Fields", or create a custom Event object with lookups to other objects. Unless Ben has a better suggestion?
Photo of Peter Bender

Peter Bender, Champion

  • 6,246 Points 5k badge 2x thumb
FYI, custom Activity lookup fields are in pilot/beta now: https://success.salesforce.com/ideaview?id=08730000000BrPdAAK
Photo of Sofware Developer Guy

Sofware Developer Guy

  • 1,354 Points 1k badge 2x thumb
Thank you for responding.  I went ahead and created a separate object 'appointments' and a related object 'rooms'.  With these models I was able to get the lanes up and running on and the calender setup the way I needed it.  It took a while, but I think I have a better understanding the way this component works. 

Thank you and Ben.
(Edited)
Photo of Emily Davis

Emily Davis, Employee

  • 3,502 Points 3k badge 2x thumb
Glad you were able to get things working. I know the calendar component (along with Salesforce Activities) can be really tricky. Let me know if you run into anything else!