+ Start a Discussion
TiborMTiborM 

Public calendar on Visualforce page?

Is it possible to add public calendar to visual forca page with some standard controller and ID?

 

Click to "change button" is very uncomfortable way and I want to just show visualforce page with one click tab.

GanjehGanjeh

If you have a public calendar already configured in your org, you could add an iframe to a VF page and reference the URL of the public calendar.  Then associate the VF with a

  • Salesforce.com site page or a
  • VF tab if you prefer. 


here's an example of the VF:

<apex:page showHeader="0" >
  <apex:iframe height="800" src="https://cs3.salesforce.com/servlet/servlet.Integration?lid=01rQ0000000CxHi&ic=1"/>
</apex:page>



This page will only be accessible by folks who can login to salesforce.com though if displayed on a public sites page...  I'm wondering if anyone has a trick for exposing the public calendar via Salesforce.com sites pages to non Salesforce.com users.  Use case: expose a public calendar hosten in Salesforce.com to the intranet for all employees to access.

clouduserclouduser

I have achieved the public calendar as below..

vf page:

------------------

<apex:page controller="CalendarController" action="/00U/c?cType=1&cal_lkid={!calendarId}&md0={!YEAR(TODAY())}&md1={!MONTH(TODAY())-1}">
Please wait...
</apex:page>

 

apex class:

-------------------------

public with sharing class CalendarController {
public String calendarId {get; set; }

public CalendarController () {
calendarId = CalendarsList__c.getValues('PubCalendar').CalID__c;
}
}

 

CalendarsList is the public custom setting of List type with the field CalID__c which holds the ID of the public calendar..

 

let me know if you need additional details..thanks

 

simar10_87@yahoo.co.insimar10_87@yahoo.co.in

It doesn't seems to be working.

 

I have created same code of VF Page:

 

<apex:page controller="CalendarController" action="/00U/c?cType=1&cal_lkid={!calendarId}&md0={!YEAR(TODAY())}&md1={!MONTH(TODAY())-1}">
Please wait...
</apex:page>

 

Then Controller:

 

public with sharing class CalendarController {
public String calendarId {get; set; }

public CalendarController () {
calendarId = Calender__c.getValues('PubCalendar').CalID__c;
}
}

 

In controller I have created Custom Setting as Calender__c and custom field as CallD__c, but there seems to be some issue it is not executing.

I am geeting the error below:

Error: CalendarController Compile Error: Illegal assignment from Decimal to String at line 5 column 1

 

Please suggest...

clouduserclouduser

did you create the Custom Setttings under Develop-> Custom Settings (List)

Label: Calendar

API Name: Calendar__c

calId__c is the Text field which holds the public calendarId.

 

hope you have created the public calender under Customize->Activitites->Public Calendars and Resources. Need to capture the calendar ID and insert this as a record in above Custom Settings List.

Name: PubCalendar

CalID__c: your calendar Id value

 

If above things are setup properly then it should work. let me know if you still face any issues

 

 

simar10_87@yahoo.co.insimar10_87@yahoo.co.in
Can you please send some Screen shots to make it easy ?
clouduserclouduser

there is a typo in apex class...

calendar__c..did you fix it?

jtb226jtb226

This worked perfect for me after adding the apex class and custom setting. A big thanks to clouduser.

clouduserclouduser

Thanks jtb226....If my solution was helpful, please mark it as a solution. This will make it available to others as a proper answer. If you felt that I went above and beyond please give me Kudos by clicking on on the star icon.

skhalidskhalid
I have tried the exact same code and setup the custom setting as well. But when I try accessing this new VF page from my Salesforce site, I get authorization required error. I have included the VF in the pages allowed by the site and also made sure that the site user has access to both the VF page and Apex controller. I setup the debug log as well but don't see any error details in there either. Can someone please help!
sam_Adminsam_Admin
@skhalid Did you figured out the error? iam getting same error