+ Start a Discussion

public calendars in apex?

Is it possible to add an event to a public calendar via apex or the API in general?  I could try it myself, but it's much quicker to ask.

Once I've added an event to a public calendar via the standard UI, I can pull up the record in Apex Explorer etc. and see that it's put in the public calendar ID as the OwnerID, but don't know if apex will let me write that value directly.  (I've noticed that one quirk of the standard UI is that while I can create an event in the public calendar if I start from that calendar, I can't take an existing event and move it to a public calendar by typing the name of the calendar in the Assigned To field (which I assume corresponds to OwnerID.)   I want to make sure there aren't similar limitations on edits for apex.

And is there any way to pull up a list of public calendars and their ID's?  I don't see the object anywhere in the scema explorer.

Thanks much!

I went ahead and tried this, and it does work.  If you pass in the public calendar ID (which AFAIK you can only get from looking at the URL in the UI) as OwnerID, it assigns the new event to that calendar.

However, I haven't been able to get it to change an existing event from one calendar to another public calendar.  This also doesn't appear to be possible in the UI.
Is this something that is intentionally not allowed, or is there some trick to doing it?

Thanks much!
We have some further questions about public calendars:

* it doesn't appear to be possible in general to create an event on a public calendar if I'm starting from a record (an Opportunity, for example)  The UI does not let me enter the name of the calendar in the Assigned To field.  However, if I start from the calendar and click New Event, it fills in the calendar name there and then accepts it.  Is there any way (short of an scontrol or apex) to create a public calendar event starting from an Opp?

* public calendar events related to an Opp don't seem to be showing up in the Activity related lists on the Opp layout.  Is there any way to get them to show up there?

Thanks much!

Message Edited by sparky on 11-28-2007 01:02 PM

Hello -

Unfortunately you have run into a few known issues/limitations with our current calendar.   To confirm:

There is no way to get a list of public calendars via API.
It is not possible to move the event from one public calendar to another or from a user to a public calendar.
It is not currently possible to create a public calendar event starting from an Opportunity.
It is true that public calendar events related to an opportunity do not show up in the related list for the opportunity.  This is also a known problem.

At this time, we do not have an ETA for when these issues may be addressed. 

Thanks, ryerkes, very much.
It helps a lot to know what the situation is, although as you can imagine, these weren't the answers I was hoping for. 

Any chance you could weigh in on this one too?:

I'm guessing the answer is no, since no-one has replied yet, but would like to know for sure.

Thanks much!

Here's my "get out the vote" grass roots campaign.

If you need more API control over the Public Calendar, please vote: http://ideas.salesforce.com/article/show/99709/make_Public_Calendar_events_firstclass_citizens?skin=adn

Public calendar events with activity reports:

We used to at least be able to run activity reports that would include events assigned to a public calendar.  As of 10/13/2008 (Winter09 release), those reporting capabilities have broken.  SF support has not provided any acceptable response to the issue.  Has anyone else run into this?

YES!  This is very frustrating.  Bad that it doesn't work, but even worse that you cannot help but assume it would.....and then find out after building assumptions around it that it does not....
Needs fixed bad.
We were able to get SF support to perform a rollback of the system to test and confirm that this functionality used to work and was broken by the upgrade.  If you push hard enough, you may get the same results.
After a year, you would think we would see some movement from SFDC on this. We are in dire need of events and resources for an application we are building and while understand the need for priorities, these calendar events and resources are still not available to the API. We could use some input from SFDC on this after all this time has gone by without any response.
We need a solution for this ASAP too.  Wonder if the new calendar in spring 2010 release will address this.  In the meantime, I'm stuck and bummed.
Unfortunately, Public Calendars continue to be neglected by the SF dev team. Our org is trying to use public calendars in our customer portal, and we are constantly being forced to reinvent the wheel for what should be trivially simple.

Hi Sparky,


I tried out same thing but did not succeed. May be I am doing something wrong. Could you please send me the code so that I can see that and make changes accordingly. I want to pass public calender ID as owner ID.


Many thanks.





I have tried to access it from the custom settings by creating the list.

Erica St. AngelErica St. Angel
In case it helps anyone who runs across this thread, I was able to create Events on Public Calendar via Process Builder (using calendar ID as owner ID) based on status change of a custom object. However to remove the event should that status again change, requires Apex Trigger (working on that now).
Owen ParkOwen Park
Hi Erica, did you manage to get the removal operational?
Owen ParkOwen Park
Hi Erica, if you see this can you please provide further information on how you set up your Process Builder.
Erica St. AngelErica St. Angel
Hi Owen - not yet. Project got stalled due to other priorities but still on list.