• Chris Woody
  • NEWBIE
  • 5 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
I have created a custom vf page to replace the campaign member related list.  The page has a button so users can log a call directly from the vf page for each record.  On my personal dev sandbox, the "Log a Call" button opens the task edit screen full page.  On the integration sandbox, it opens it in the page section of the page layout.  Is there some setting that is causing this?

Here is the code for my vf page:

<apex:page Standardcontroller="Campaign" extensions="CampaignMemberExtension" action="{!getData}" sidebar="false" >
    <apex:form >
        <apex:pageBlock >

          <!-- To show page level messages -->
          <apex:pageMessages ></apex:pageMessages>       
            <apex:actionFunction action="{!UpdateRecords}" name="updateRecords" rerender="pageBlock" status="status"></apex:actionFunction>           
            <apex:pageBlockTable value="{!CampaignMembers}" var="cm">
               <apex:column headerValue="Type">
                 <apex:outputText value="{!IF(cm.Contact.id = null, 'Lead', 'Contact')}"/>
               </apex:column>
               <apex:Column value="{!cm.Status}"/>
               <apex:Column headerValue="Name">
                 <apex:outputLink value="{!IF(cm.Contact.id = null,URLFOR($Action.Lead.View, cm.Lead.Id),URLFOR($Action.Contact.View, cm.Contact.id))}">
                  <apex:outputText value="{!IF(cm.Contact.id = null, cm.Lead.Name, cm.Contact.name)}"/>
                    </apex:outputLink>
               </apex:Column>
               <apex:Column headerValue="Title">
                 <apex:outputText value="{!IF(cm.Contact.id = null, cm.Lead.Title, cm.Contact.Title)}"/>
               </apex:Column>
               <apex:Column headerValue="Account">
                 <apex:outputText value="{!IF(cm.Contact.id = null, cm.Lead.Company, cm.Contact.Account.name)}"/>
               </apex:Column>
               <apex:column headerValue="Opt Out">
                    <apex:inputField value="{!cm.Opt_Out__c}"  onchange="updateRecords();" />
               </apex:column> 
               <apex:column headerValue="Attempts">
                   <apex:inputField value="{!cm.Attempts__c}"  onchange="updateRecords();" />
               </apex:column> 
               <apex:column >
                   <apex:commandButton action="{!URLFOR($Action.Activity.LogCall,null,[retURL=URLFOR($Action.Campaign.view,cm.Campaign.Id), what_id=cm.Campaign.Id,who_id=IF(cm.Contact.id = null, cm.Lead.id, cm.Contact.id)],true)}" value="Log A Call"/>
               </apex:column>   
            </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:form>   
</apex:page>

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.