Monday, June 30, 2014

Publisher Actions

The publisher actions feature lets you create actions and add them to the Chatter publisher on the home page, on the Chatter tab, in Chatter groups, and on record detail pages. Actions also appear in the action tray in Salesforce1.Actions enable users to do more in Salesforce and in Salesforce1, such as create or update records and log calls directly in the Chatter feed or from the users’ mobile devices.
There are several types of actions:
Standard actions are actions that are automatically included when Chatter is enabled—like Post, File, Link, and Poll. You
can customize the order in which these appear, but you can’t edit their properties.
Create actions let users create records. They’re different from the Quick Create and Create New features on the Salesforce
home page, because create actions respect validation rules and field requiredness, and you can choose each action’s fields.
Log a call actions let users record the details of phone calls or other customer interactions. These call logs are saved as
completed tasks.
Send email actions, available only on cases, give users access to a simplified version of the Case Feed Email action on
Salesforce1.
Update actions let users make changes to a record from the record’s feed.
Question actions let users ask and search for questions about the records they’re working with.
Custom actions are Visualforce pages or canvas apps with functionality you define. For example, you might create a custom action to let users write comments longer than 5000 characters, or one that integrates a video conferencing application so support agents can communicate visually with customers.
For create, log-a-call, and custom actions, you can create either object-specific actions or global actions. Update actions must be object-specific.

Step 1: Enable Publisher Actions 
Step 2: Default Actions

Step 3: Object Specific Actions and Layouts 




Step 4: Add Publisher Actions to Page Layout or Global Publisher Layouts



Step 5:Creating Visualforce Pages to Use as Custom Actions
a)Creating Pages for Object-Specific Custom Actions: Visualforce pages you create to use as object-specific actions need to use one of the standard object controllers.
The following code sample shows a page designed to be used as a custom action on the account object, so it uses the standard Account controller. This action lets users create cases from account detail pages, and it has a different user interface from standard create actions.
public with sharing class CreateCaseExtension { private final SObject parent; public Case theCase {get; set;} public String lastError {get; set;} public CreateCaseExtension(ApexPages.StandardController controller) { parent = controller.getRecord(); theCase = new Case(); theCase.accountId = parent.id; lastError = ''; } public PageReference createCase() { createNewCase(); theCase = new Case(); theCase.accountId = parent.id; return null; } private void createNewCase() { try { insert theCase; FeedItem post = new FeedItem(); post.ParentId = ApexPages.currentPage().getParameters().get('id'); post.Body = 'created a case'; post.type = 'LinkPost'; post.LinkUrl = '/' + theCase.id; post.Title = theCase.Subject; insert post; } catch(System.Exception ex){ lastError = ex.getMessage(); } } }
<apex:page standardcontroller="Account" extensions="CreateCaseExtension" showHeader="false">
<script type='text/javascript' src='/canvas/sdk/js/publisher.js'/>
<style>
.requiredInput .requiredBlock, .requiredBlock {background-color: white;}
.custompubblock div {display: inline-block;}
.custompublabel {width:54px;}
</style>
<script>
function refreshFeed() {
Sfdc.canvas.publisher.publish({name : 'publisher.refresh', payload :
{feed:true}});
}
</script>
<div>
<apex:form >
<apex:actionFunction action="{!createCase}" name="createCase" rerender="out"
oncomplete="refreshFeed();"/>
<apex:outputPanel id="out" >
<div class="custompubblock">
<div class="custompublabel">Account:</div><apex:inputField value="{!theCase.accountId}"
style="margin-left:0;"/>&nbsp;&nbsp;&nbsp;
<div>Contact:&nbsp;</div><apex:inputField value="{!theCase.contactId}"
/>
</div>
<apex:inputField value="{!theCase.description}"
style="width:538px;height:92px;margin-top:4px;" />
<div class="custompubblock" style="margin-top:5px;">
<div>Status:&nbsp;</div><apex:inputField value="{!theCase.status}"
/>&nbsp;&nbsp;&nbsp;
<div>Priority:&nbsp;</div><apex:inputField value="{!theCase.priority}"
/>&nbsp;&nbsp;&nbsp;
<div>Case Origin:&nbsp;</div><apex:inputField value="{!theCase.origin}"
/>
</div>
</apex:outputPanel>
</apex:form><br/>
<button type="button" onclick="createCase();"
style="position:fixed;bottom:0px;right:0px;padding:5px 10px;
font-size:13px; font-weight:bold; line-height:
18px;background-color:#0271BF;background-image:-moz-linear-gradient(#2DADDC,
#0271BF);background-repeat:repeat-x;border-color:#096EB3;"
id="addcasebutton">Create Case</button>
</div>
</apex:page>
                                 


b)Pages for Global Custom Actions:
public with sharing class CreateCaseController {     public Case theCase {get; set;}     public String lastError {get; set;}     public CreateCaseController() {         theCase = new Case();         lastError = '';     }            public PageReference createCase() {         createNewCase();         theCase = new Case();         return null;     }              private void createNewCase() {               try {             insert theCase;                          FeedItem post = new FeedItem();             post.ParentId = ApexPages.currentPage().getParameters().get('id');             post.Body = 'created a case';             post.type = 'LinkPost';              post.LinkUrl = '/' + theCase.id;             post.Title = theCase.Subject;             insert post;         } catch(System.Exception ex){            lastError = ex.getMessage();         }     }    }
<apex:page controller="CreateCaseController" showHeader="false">
<script type='text/javascript' src='/canvas/sdk/js/publisher.js'/>
<style>
.requiredInput .requiredBlock, .requiredBlock {background-color: white;}
.custompubblock div {display: inline-block;}
.custompublabel {width:54px;}
</style>
<script>
function refreshFeed() {
Sfdc.canvas.publisher.publish({name : 'publisher.refresh', payload : {feed:
true}});
}
</script>
<div>
<apex:form >
<apex:actionFunction action="{!createCase}" name="createCase" rerender="out"
oncomplete="refreshFeed();"/>
<apex:outputPanel id="out" >
<div class="custompubblock">
<div>Subject:&nbsp;</div><apex:inputField value="{!theCase.subject}"
style="width:500px;" />
</div>
<div class="custompubblock">
<div class="custompublabel">Account:</div><apex:inputField value="{!theCase.accountId}"
style="margin-left:0;"/>&nbsp;&nbsp;&nbsp;
<div>Contact:&nbsp;</div><apex:inputField value="{!theCase.contactId}"
/>
</div>
<apex:inputField value="{!theCase.description}"
style="width:500px;height:92px;margin-top:4px;" />
<div class="custompubblock" style="margin-top:5px;">
<div>Status:&nbsp;</div><apex:inputField value="{!theCase.status}"
/>&nbsp;&nbsp;&nbsp;
<div>Priority:&nbsp;</div><apex:inputField value="{!theCase.priority}"
/>&nbsp;&nbsp;&nbsp;
<div>Case Origin:&nbsp;</div><apex:inputField value="{!theCase.origin}"
/>
</div>
<div style="color:red;">{!lastError}</div>
</apex:outputPanel>
</apex:form><br/>
<button type="button" onclick="createCase();"
style="position:fixed;bottom:0px;right:0px;padding:5px 10px;
font-size:13px; font-weight:bold; line-height:
18px;background-color:#0271BF;background-image:-moz-linear-gradient(#2DADDC,
#0271BF);background-repeat:repeat-x;
border-color:#096EB3;" id="addcasebutton">Create Case</button>
</div>
</apex:page>
                       





Step 6:Create Object-Specific Actions and Setting Predefined Field values




Step 7:Reorder actions in Global Publisher Layout and Assign to Profiles



Step 8:Tips
Use these tips as you set up actions to make the feature easy to use and easy to maintain.
a)Tips for Creating Actions
• Action labels longer than approximately 12-14 characters are shortened when they’re displayed in the Chatter publisher. Keep the names short and descriptive.
• Give your actions task-oriented names that tell your users what they do. Use verbs like New, Create, Share, Update, or Import.
• Use the Description field to create notes for yourself about each action. This is especially useful if you’re creating several similar actions for different record types, for example. The description appears in the list of buttons, links, and actions for object-specific actions, or in the list of global actions, as well as on the detail page for the action. Your notes aren’t visible to users.
• When creating custom actions that are going to be displayed in the Chatter publisher, limit their height to 400 pixels so that they are displayed correctly. 
b)Tips for Laying Out Actions
• When customizing action layouts, consider what your users will do with them. Minimalism is key. Include only the fields that are really necessary both for them and for whomever will handle the cases, calls, or records that result from those actions.
• To create a single-column layout, such as for display on mobile devices, add fields only in the left column.
• Use predefined field values to set standard values for common fields. For example, on an action that lets users create
opportunities, you might set Prospecting as the predefined value for the Stage field. All new opportunities created through
that action will automatically be assigned to the prospecting stage.If you predefined 
values for fields on object records created through an action, you don’t need to add those fields to the action layout.
• Use the Preview As... button on the Action Layout Editor to see how an action layout will appear to different user profiles.
c)Tips for Adding Actions to Publishers
• Because adding too many actions can cause the page to load slowly, we recommend including no more than nine actions total in each publisher, including any standard actions.
• In the full Salesforce site, if you include five or more actions in a publisher, three are shown and the rest are added to the publisher’s More menu. If you include four or fewer actions, they’re all shown.
• In Salesforce1, the first six actions show up on the first page of the actions tray.



Sunday, June 29, 2014

Service Cloud Console

Step 1 : Introduction to Salesforce Console



A Service Cloud console is an app that’s designed for users in fast-paced environments who need to find, update, and create records quickly. It improves on the Console tab by letting you:
• Work with fewer clicks and less scrolling
• Limit switching between pages
• Use keyboard shortcuts to perform actions
• Easily spot important fields on records
• See records and their related items as tabs on one screen so that you never lose context or navigate too far from a record
• Jot notes on each record in an interaction log
• See visual indicators in real time when lists and records are changed by others
• Solve cases by quickly scanning Salesforce Knowledge articles
• Access a SoftPhone for Salesforce CRM Call Center in a footer instead of a sidebar
• Chat with customers in real time using Live Agent

Step 2:Customizing Highlights Panels for a Service Cloud Console
1. Edit any page layout and click Layout Properties.
2. Check Highlights Panel, and click OK.
3. Click Save.


Step 3:Creating a Service Cloud Console App











Step 4:Adding Custom Console Components to Page Layouts
1.For standard objects, from Setup, click Customize > Object > Page Layouts.
   For custom objects, from Setup, click Create > Objects, then choose the object.
2. Click Edit next to a page layout.
3. Click Custom Console Components.
4. Next to the sidebar in which you want to add your component, type the name of the Visualforce page and select the Visualforce page.
5. Enter the height or width of the component as it should display in a console.
6. Click Save.

Adding Custom Console Components to Apps
1. From Setup, click Customize > Service Cloud Console > Custom Console Components.
2. Click New.
3. Type a name for your component.
4. Click Hide to hide your component from console users.Hidden components don’t display to console users, but they can still function in the background.
5. In Button Name, type the label that will display on the button users click to launch your component. For example, Live Chat.
6. In Button CSS, enter the in-line style used to define how the button looks to users who click it to launch your component.
7. Enter the width of the button as it should display in the console.
8. In Visualforce Page, type the name of your component and select it.
9. Enter the height and width of the window used to display your component in the console.
10. Click Fixed Width or Fixed Height to prevent users from changing the dimensions of the window used to display your component.
11. Click Save.






Tuesday, June 24, 2014

Outlook Configuration

Salesforce for Outlook:
Outlook configurations define the settings that are applied to Salesforce for Outlook for specific groups of users.It’s easy to keep your contacts, events, and tasks synced between Microsoft® Outlook® and Salesforce. And by enabling the Salesforce Side Panel, you can add Outlook emails and events to the Salesforce records of your choice, as well as create new Salesforce records—all directly in Outlook
Step 1:Administrator Setup



Step 2:Download Salesforce for Outlook

 Using Side Panel in Outlook :








Sync Direction


New Features








Monday, June 23, 2014

Custom Visualforce Action

Custom Visualforce Action:
Visualforce pages you create to use as object-specific actions need to use one of the standard object controllers.The following code sample shows a page designed to be used as a custom action on the account object, so it uses the standard Account controller. This action lets users create cases from account detail pages, and it has a different user interface from standard create actions.

Step 1: Create Apex Class
public with sharing class CreateCaseExtension {
    private final SObject parent;
    public Case theCase {get; set;}
    public String lastError {get; set;}
    
    public CreateCaseExtension(ApexPages.StandardController controller) {
        parent = controller.getRecord();
        theCase = new Case();
        theCase.accountId = parent.id;
        lastError = '';
    }
      
    public PageReference createCase() {
        createNewCase();
        theCase = new Case();
        theCase.accountId = parent.id;
        return null;
    }
       
     private void createNewCase() {      
        try {
            insert theCase;
            
            FeedItem post = new FeedItem();
            post.ParentId = ApexPages.currentPage().getParameters().get('id');
            post.Body = 'created a case';
            post.type = 'LinkPost'; 
            post.LinkUrl = '/' + theCase.id;
            post.Title = theCase.Subject;
            insert post;
        } catch(System.Exception ex){
           lastError = ex.getMessage();
        }
    }   
}

Step 2: Create VF Page
<apex:page standardcontroller="Account" extensions="CreateCaseExtension" showHeader="false">
    <script type='text/javascript' src='/canvas/sdk/js/publisher.js'/> 
    <style>
        .requiredInput .requiredBlock, .requiredBlock {background-color: white;} 
        .custompubblock div {display: inline-block;} 
        .custompublabel {width:54px;} 
    </style>
    <script> 
        function refreshFeed() { 
            Sfdc.canvas.publisher.publish({name : 'publisher.refresh', payload : {feed:true}}); 
        }
    </script>   
    <div> 
        <apex:form > 
            <apex:actionFunction action="{!createCase}" name="createCase" rerender="out" 
            oncomplete="refreshFeed();"/> 
            <apex:outputPanel id="out" > 
                <div class="custompubblock"> 
                    <div class="custompublabel">Account:</div><apex:inputField value="{!theCase.accountId}" 
                    style="margin-left:0;"/>&nbsp;&nbsp;&nbsp;
                    <div>Contact:&nbsp;</div><apex:inputField value="{!theCase.contactId}" />
                </div>
                <apex:inputField value="{!theCase.description}" style="width:538px;height:92px;margin-top:4px;" />
                <div class="custompubblock" style="margin-top:5px;"> 
                    <div>Status:&nbsp;</div><apex:inputField value="{!theCase.status}" />&nbsp;&nbsp;&nbsp; 
                    <div>Priority:&nbsp;</div><apex:inputField value="{!theCase.priority}" />&nbsp;&nbsp;&nbsp; 
                    <div>Case Origin:&nbsp;</div><apex:inputField value="{!theCase.origin}" /> 
                </div> 
            </apex:outputPanel>
        </apex:form><br/>
        <button type="button" onclick="createCase();" 
        style="position:fixed;bottom:0px;right:0px;padding:5px 10px; 
        font-size:13px; font-weight:bold; line-height: 
        18px;background-color:#0271BF;background-image:-moz-linear-gradient(#2DADDC, #0271BF);background-repeat:repeat-x;border-color:#096EB3;" 
        id="addcasebutton">Create Case</button> 
    </div>  
</apex:page>

Step 3: Create Action of Type Visualforce on Account
Step 4: Add action to Account Page Layout
Step 5: Finally use Visualforce action on detail page 



Pages for Global Custom Actions :
Pages you create to use as global actions can’t use any of the standard object controllers.
The following code sample shows a Visualforce page designed to be used as a custom action on any object that supports actions.This action lets users create cases from record detail pages, Chatter, Chatter groups (except customer groups), or the home page, and it has a different user interface from standard create actions. As with all global actions, the records created through this action are not automatically associated with any other records.
Step 1: Create Apex Class
public with sharing class CreateCaseController {
public Case theCase {get; set;}
public String lastError {get; set;}
public CreateCaseController() {
theCase = new Case();
lastError = '';
}
public PageReference createCase() {
createNewCase();
theCase = new Case();
return null;
}
private void createNewCase() {
try {
insert theCase;
FeedItem post = new FeedItem();
post.ParentId = ApexPages.currentPage().getParameters().get('id');
post.Body = 'created a case';
post.type = 'LinkPost';
post.LinkUrl = '/' + theCase.id;
post.Title = theCase.Subject;
insert post;
} catch(System.Exception ex){
lastError = ex.getMessage();
}
}
}

Step 2: Create VF Page
<apex:page controller="CreateCaseController" showHeader="false">
<script type='text/javascript' src='/canvas/sdk/js/publisher.js'/>
<style>
.requiredInput .requiredBlock, .requiredBlock {background-color: white;}
.custompubblock div {display: inline-block;}
.custompublabel {width:54px;}
</style>
<script>
function refreshFeed() {
Sfdc.canvas.publisher.publish({name : 'publisher.refresh', payload : {feed:
true}});
}
</script>
<div>
<apex:form >
<apex:actionFunction action="{!createCase}" name="createCase" rerender="out"
oncomplete="refreshFeed();"/>
<apex:outputPanel id="out" >
<div class="custompubblock">
<div>Subject:&nbsp;</div><apex:inputField value="{!theCase.subject}"
style="width:500px;" />
</div>
<div class="custompubblock">
<div class="custompublabel">Account:</div><apex:inputField value="{!theCase.accountId}"
style="margin-left:0;"/>&nbsp;&nbsp;&nbsp;
<div>Contact:&nbsp;</div><apex:inputField value="{!theCase.contactId}"
/>
</div>
<apex:inputField value="{!theCase.description}"
style="width:500px;height:92px;margin-top:4px;" />
<div class="custompubblock" style="margin-top:5px;">
<div>Status:&nbsp;</div><apex:inputField value="{!theCase.status}"
/>&nbsp;&nbsp;&nbsp;
<div>Priority:&nbsp;</div><apex:inputField value="{!theCase.priority}"
/>&nbsp;&nbsp;&nbsp;
<div>Case Origin:&nbsp;</div><apex:inputField value="{!theCase.origin}"
/>
</div>
<div style="color:red;">{!lastError}</div>
</apex:outputPanel>
</apex:form><br/>
<button type="button" onclick="createCase();"
style="position:fixed;bottom:0px;right:0px;padding:5px 10px;
font-size:13px; font-weight:bold; line-height:
18px;background-color:#0271BF;background-image:-moz-linear-gradient(#2DADDC,
#0271BF);background-repeat:repeat-x;
border-color:#096EB3;" id="addcasebutton">Create Case</button>
</div>
</apex:page>    

Step 3: Create Global Action
Step 4: Add to Chatter Group Layout
 Step 5: Finally use Visualforce Global Action on Group 
                            

Sunday, June 22, 2014

Historical Trending & Embedded Analytics

Historical Trending Report:
To make historical trend reports available to your users, use filters to configure the amount of data that’s captured for historical reporting and then select the fields that will be available for historical reports.

1. Enable Historical Trending


2.Create a Historical Trending report by selecting appropriate report type







After you enable historical trending, a new custom report type is available for users to choose when they create a new report. If you enable historical trending on a new field, that field is automatically added to the historical trending report layout.
If you need to turn off historical trending, keep these points in mind.
When you turn off historical trending for a field, that field’s historical data is deleted.
When you turn off historical trending for an object, all historical data and configuration settings are deleted for that object, including the object’s historical trending report type and any reports that have been created with it.
When you turn off historical trending for a field, and then delete that field, the field’s historical data will not be available if historical trending is enabled again.

Embedded Analytics:
Typically, users have had to navigate to the Reports tab to find data. But you can give them valuable information directly on the pages they visit often. To do that, just embed report charts in detail pages for standard or custom objects. When users see charts on pages, they are empowered to make decisions based on data they see in the context of the page without going elsewhere to look for it
Keep below in your mind before implement embedded analytics.



created two reports and added chart to these reports and pass account id from your page layout settings as shown below






Limitations :
You can have two report charts per page.
You can only add report charts from the enhanced page layout editor. The mini console and the original page layout editor are not supported.
On detail pages, users can refresh up to 100 report charts every 60 minutes.
Your organization can refresh up to 3,000 report charts every 60 minutes.