Pages

Friday, October 10, 2008

Bringing Google Calendar into Salesforce CRM pages


Since the very first time I saw Google Calendar' API, I wondered if it can be used for any bizarre or genius applications (having a sense of a-tool-for-public) or not. For example I really liked to be able to load Google Calendar into my page and then using the API add as many events as I desire on it from my own database without any authentication requirement and just for the sake of showing the data to user, but I have not been able to get it work in that order so far.

Yet there are a lot of other benefits that Google Calendar can bring along, in terms of sharing events, publishing, flexibility and integration with other portals/applications in the cloud.

One of things you might find useful is the capability of sharing a Google public calendar with your Salesforce CRM users.

At first I tried to publish my own personal calendar into Salesforce, and I was successful to some extent. I could see the calendar is being shown properly and I can switch between the weekly, monthly, etc views. All nice, but I noticed that the Calendar is empty and my events are missing.

In Google Calendar's documentation is not mentioned that you should use a public calendar to be able to share it in other websites or maybe that goes without saying! So I initially thought that any Calendar could be shared and as long as my event is set as public people should be able to see them.

It was more like one of those scenarios where you show a button on your page to a user but say "Do not click on it, ok my boy?"

Anyway, in order to publish the calendar on your Salesforce CRM, you should first think about where you want to place it and you may require to create a new Visualforce page before copying the calendar HTML code into it.

In order to get the calendar's HTML code go to your Google Calendar page and either create a new Calendar to publish it as public calendar or if you already have one then click on settings (on the left side of the screen).

Once you have your public calendar ready go to its "details" page and look for a spot that says "Embed This Calendar", copy the code and paste it into your Visualforce page. That's all!



<apex:page tabStyle="Campaign">
<apex:form >
</apex:form>
<iframe src="http://www.google.com/calendar/embed?src=6lectl1l76jrmul8st527rbq6c%40group.calendar.google.com&ctz=America/New_York&color=%23336699;" style="border: 0" width="800" height="600" frameborder="0" scrolling="no"></iframe>
</apex:page>



And you will see something like below in your page:

3 comments:

  1. Do you know of a way that we could use Google Calendar to map out Opportunity Close Dates on a calendar?

    Thanks!

    Jeff Davidson
    Dulles, VA

    ReplyDelete
  2. This only works for one calendar. Is there a way to embed multiple google calendars in a VF page other than on the home page? If i try to display multiple calendars it just shows an empty calendar.

    ReplyDelete
  3. I also have the multiple or non-default calendar question. I'd like to embed a specific calendar. Also, I'd like to create a custom button on an Opportunity object that takes two date fields and creates an/or multiple day event on a google calendar. I also have two time fields that would be nice if I were able to get incorporated to the event. I think it would work best if I were to create ONE event with an option for number of days long, possibly using a new field on the Opp object called "event Length in Days" or something to that effect. Please help, I've searched everywhere and have had little results for this one.

    ReplyDelete