function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Pat McQueenPat McQueen 

Adding a Salesforce Calendar to Salesforce1 ... [Solved]

Salesforce1 has a great Today page which shows the users calendar mashed up with salesforce.com. It works well when the user is not using Salesforce as their primary calendar.  However many want to use Salesforce as the primary calendar.  So - How then do you display a calendar in Salesforce1?

 

This is a hack - but an easy one which works!  Here is how to add a Salesforce calendar to Salesforce1:

 

1) Create a visualforce page "My Calendar"  Be sure to make the page available for salesforce mobile apps.  The content of the page should be:

 

<apex:page showHeader="false" sidebar="false" >

<div style="overflow:scroll; width:100%; height:100%;">
    <object type="text/html" data="https://na2.salesforce.com/00U/c?isdtp=mn"
            style="overflow:scroll; width:1200px; height:2400px;">
    </object>
</div>

</apex:page>

 

2) Add a VisualForce tab for the visualforce page called my calendar.  Ensure the users can access the tab but make it hidden.  Does not need to be mobile ready as that setting is for the Classic Mobile app.

3) Under Mobile Administration / Moble Navigation add the "My Calendar" Visualforce tab to the selected Navigation menu item.

4) Login to Salesforce1 and celebrate your job well done!

 

I hope you find this as useful as I did.

 

 

 

tdavistdavis

I successfully added this to the Salesforce1 app; however, when I click on "My Calendar" on the Salesforce1 app (iOS) all that comes up is a blank page where I can scroll down and over.

Pat McQueenPat McQueen
Are you using na2? You may need to change the URL to the page. Try the link in the data tag in a browser to make sure it works. e.g. https://na2.salesforce.com/00U/c?isdtp=mn
tdavistdavis

Yeah the link is working. It's just not working on the Salesforce1 app.

tdavistdavis

Got it to work. I used n3 rather than n2.


Thanks so much!

Pat McQueenPat McQueen

Strange ... Can you try this?

 

<apex:page showHeader="false" sidebar="false" >

<b>Hello World!</b>
</apex:page>
Pat McQueenPat McQueen

so I tried moving this into production - it worked great on my DE org - however in production i can;t get it to work.  We are using mydomain and i suspect there is something going on there ... any ideas on how to toubleshoot?

Pat McQueenPat McQueen

So this is interesting.

 

In the failing org the tab that is created uses

https://mfa--c.na7.visual.force.com/apex/MyCal

 

and in the working org the url is 

https://na2.salesforce.com/apex/mucal?sfdc.tabName=01r40000000Q9mT

 

my guess is that the object reference is failing due to the webkit cross site concerns ... I am going to test this by turning on my domain in the developer org and see if I can get this to work ...

 

Any ideas on how to work around this if it fails?

Pat McQueenPat McQueen

well ...

 

After turning on MyDomain in the DE og it appears the links are not using the force.com domain ... the tabs created for the calendar use https://patmcqueen-dev-ed.my.salesforce.com/apex/mucal

 

Why in the heck does the production org use

https://mfa--c.na7.visual.force.com/apex/MyCal

 

The issue is that in producton it uses the visual.force.com domain and then I have the dreaded SAMEORIGIN issue

 

pat

Atlanta David AAtlanta David A

Sadly, this is not working for me either -- I get the same whitre screen.

 

I used the following and iterated the na## a few time to see if that made a difference and it does not:

 

<apex:page showHeader="false" sidebar="false" >

<div style="overflow:scroll; width:100%; height:100%;">
    <object type="text/html" data="https://na14.salesforce.com/00U/c?isdtp=mn"
            style="overflow:scroll; width:1200px; height:2400px;">
    </object>
</div>

</apex:page>

 

Interestingly, I skipped the step to hide the tab so it appears in my main application.  When I click on it, I also get a white screen, but the URL changes to https://c.na14.visual.force.com/apex/My_Calendar?sfdc.tabName=01rd00000007RlO

 

I had thought the idea was to make Salesforce1 app display the https://na14.salesforce.com/00U/c?isdtp=mn link content which does come up in my browser as my calendar.

 

Help?

 

cesidescesides

Thank you very much for posting.  I found this very useful, not only for the Calendar function but helped me understand better how to expose other visualforce pages within Salesforce1!

 

I created in production and updated the code to NA8 which is where my org lives and it works perfectly on the ipad.

Atlanta David AAtlanta David A

I should note that the above applies to a Samsung Galaxy S4 device.

 

Interestingly, I tried this on the iPad and it worked fine.

cookjeremiahcookjeremiah

Hey, I have the same issue, works fine on IOS but on android, comes up with a blank white screen, if anyone figures this out for android, let us know.  For now I only have a solution that works on ios.

afreemanafreeman
I've set up everything appropriately, but I don't see it as an option on my mobile device yet. is there something I need to do for the SF1 on my phone to update with the new app?
sales.forcesales.force

Thanks for the tip! It works great in IOS but sadly not on Android.

According to Salesforce:
"Visualforce Mobile is only available for BlackBerry and iPhone. If you mobilize a Visualforce tab, keep in mind that Android users can’t view the tab in Salesforce Classic."  (source: http://www.salesforce.com/us/developer/docs/mobileImplGuide/Content/define_mobile_tabs.htm)

Most of my users are on iPhone so I think I'll create a permission set for this tab and only unhide it for those that use iPhone.

 

mattl1.3964693318980662E12mattl1.3964693318980662E12
Can someone please help with why it it adds the "https://c.na15.salesforce.com/00U/c?isdtp=mn" in front of the "https://na15.salesforce.com/00U/c?isdtp=mn"

All I keep getting is a blank screen.

Thanks.
afreemanafreeman
Matt, 
It might a browser issue, I use chrome and it works.
Chris WoodyChris Woody
I'm trying to use this code and when I try to save it I receive the following error:
The value of attribute "data" associated with and element type "object" must not contain the '<' character.

Did anyone else have this problem?
Shiva PasumartyShiva Pasumarty
Please find the steps below for implementing Calendar in Salesforce1 mobile app:

1. Create a visualforce page with the name My Calendar & copy this code from below:
<apex:page showHeader="false" sidebar="false" >
<script type="text/javascript">
window.location = "https://ap1.salesforce.com/00U/c?isdtp=mn"
</script>
</apex:page>

2. Create a Visualforce tab for the above page.
3. Navigate to Mobile Administration from Setup  type “mobile navigation” in sidebar search and then click on it.
4. Drag the above tab into the Selected list and save it.
5. Login to Salesforce1 and click on the left sidebar to view the newly created Visualforce Tab.
6. Click on it view the Calendar to view the respective events.
jojawsjojaws
Im trying so hard to make this work, but like others on this feed, i keep getting a blank white page? Has anyone been able to get this to work? When i enter "https://ap1.salesforce.com/00U/c?isdtp=mn" in my web browser on my macbook it takes me to my calendar, but i can't get it to appear as a tab on Salesforce1. Please help.. I'd love to have this function for our org

Pat McQueenPat McQueen
is your server ap1? If not change the ap1 to na1 or na6 or whatever. pat
jojawsjojaws
I 've tried that... it is na3, so ive entered the code below:

<apex:page showHeader="false" sidebar="false" >

<script type="text/javascript">

window.location = "https://na3.salesforce.com/00U/c?isdtp=mn"

</script>

</apex:page>

still opens as a blank white page 
John EichsteadtJohn Eichsteadt
Shiva: I used your code, and I now have the calendar showing up on my iPhone, but I'm getting a blank screen when I try it from an Android phone. Any ideas why? The Androids were a Galaxy 5s and Note 3 (v 4.4.2).
Silvia Timón PioteSilvia Timón Piote
I've used Shiva code (only changing the server to an emea one) and It works nicely in an Android phone (Nexus 5, v 4.4.3), thanks a lot for sharing this Shiva!
Maybe the blank screen it's something related to the access of profiles to the visualforce page?

Yael PellegYael Pelleg
Thanks for this code I used it and it looks great! I have one thing that isn't working and I was wondering if others are facing the same issue. On the "Related To" field when I lookup a record for a particular object I can't select it and therefore cannot populate that field. Any suggestions?
Shannon Gilmour 5Shannon Gilmour 5
I also ran into this but found this known issue: https://success.salesforce.com/issues_view?id=a1p30000000T3uIAAS.  
davelelanddaveleland
Just checking if anyone has this working with "My Domain".

Dave