Sales Pipeline Management | Salesforce Tutorials

Sales Pipeline Management : In our previous salesforce tutorial we have learned about Salesforce Apex language. In this Salesforce Training Tutorial we are going to learn about Salesforce Opportunity management. Salesforce opportunity management is nothing but finding better marketing automation  solutions which increases the performance of the sales team in an organization.This process is also known as Sales pipeline management.

In this Salesforce Sales Pipeline Management Tutorial we have to follow some steps to add sales stages on Salesforce.com home page. The main aim of this salesforce Training Tutorial is to show opportunity sales stages description on the home page.

Sales Pipeline Management

Go to Setup=>Customize=>Opportunities=>Fields.

Sales Pipeline Management | Salesforce Tutorials

Now go to Stage and Edit as shown below.

Sales Pipeline Management | Salesforce Tutorials

Now go to Opportunity Stages Picklist=>Prospecting.

Sales Pipeline Management | Salesforce Tutorials

Select Edit Button as shown above.

Sales Pipeline Management | Salesforce TutorialsEnter description in the description field and Save it.

Now we have to create ab Apex class to show Opportunity sales stages on salesforce.com home page. To create Apex class follow the steps as shown below.

Go to Setup=>Develop=>Apex Classes.

Sales Pipeline Management | Salesforce Tutorials

Now Select New.

Sales Pipeline Management | Salesforce Tutorials

 Now copy and paste the code as shown below.

[codesyntax lang=”sql” lines_start=”0″ title=”Code” doclinks=”1″]

public class clsHelpSalesStages{
      List<OpportunityStage> lstOppStage = [ SELECT MasterLabel, 
                           IsClosed,
                           IsWon, 
                           ForecastCategory, 
                           ForecastCategoryName, 
                           DefaultProbability, 
                           Description
                    FROM OpportunityStage
                    WHERE IsActive = true
                    ORDER BY SortOrder ASC ];
    return lstOppStage;
  }
    public static testMethod void testMyController(){
    clsHelpSalesStages objOppStage = new clsHelpSalesStages();
    List<OpportunityStage> lstOppStageTest = objOppStage .getSalesStages();
   
    System.assert( lstOppStageTest.size() > 0 );
  }
}

[/codesyntax]

Now Save the code.

Sales Pipeline Management | Salesforce Tutorials

Sales Pipeline Management

After creating Apex Class we have to create Visualforce Page  to show Opportunity Sales stages on Home page.Follow the steps shown below.

Go to Setup=>Develop=>Pages.

Sales Pipeline Management | Salesforce Tutorials

Select New Button.

Sales Pipeline Management | Salesforce Tutorials

Enter the Label Field as VfHelpSalesStags and Name Field will be automatically generated. Use the code to create visualforce Page.

[codesyntax lang=”sql” lines_start=”0″ title=”Visualforce Page “]

<apex:page controller="clsHelpSalesStages" tabStyle="Opportunity" showHeader="false" sidebar="false">
<apex:form >
<apex:sectionHeader title="Sales Stages Description. Date: {!NOW()}"/>
<apex:pageBlock title="">
<apex:pageMessages ></apex:pageMessages>
<apex:pageBlockTable value="{!SalesStages}" var="s" rendered="{!NOT(ISNULL(SalesStages))}">
<apex:column >
<apex:facet name="header">Name</apex:facet>
<div style="background-color:{!CASE(s.ForecastCategoryName,'Closed','maroon','Omitted','#FFA07A','Commit','green','Funnel','blue','gray')}; 
color:{!CASE(s.ForecastCategoryName,'Omitted','black','white')}">
{!s.MasterLabel}
</div>
</apex:column>
<apex:column value="{!s.DefaultProbability}"></apex:column>
<apex:column value="{!s.Description}"></apex:column>
<apex:column value="{!s.ForecastCategoryName}"></apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>

[/codesyntax]

Sales Pipeline Management | Salesforce Tutorials

Sales Pipeline Management

 After Creating Visualforce we have to set some security settings for the profiles in our organization.

Now go to Visualforce page=> Select Security.

Sales Pipeline Management | Salesforce Tutorials

Select the User profile to which you want to enable Sales Opportunity Stages on home pages.

Now Go to Setup=>Customize=>Home=>Home page Components.

Sales Pipeline Management | Salesforce Tutorials

Now enter Name as Opportunity sales stage and select Type as HTML area.

Sales Pipeline Management | Salesforce Tutorials

Sales Pipeline Management

Click on Next Button and Select Wide (Right) Column in component position and use the following code.

[codesyntax lang=”sql” lines_start=”0″ title=”Opportunity Sale Stage”]

iframe style="width: 100%; height : 400px; src="/apex/vfHelpSalesStages"frameBOrder="0"></iframe>

[/codesyntax].

Click on Save button.

After saving we have to customize our home page layout so that Our Opportunity Sales stage is to appear on Home page.

Go to Setup=>Customize=>Home=>Home page Layouts=>Edit.

Sales Pipeline Management | Salesforce Tutorials

Now select Opportunity Sales Stage check box to enable on home page.

Sales Pipeline Management | Salesforce Tutorials

Select Next button and now move he fields to your required position.

Sales Pipeline Management | Salesforce Tutorials

Now Save.

Go to to your Home page and you will find Opportunity sales stages as shown below.

Sales Pipeline Management | Salesforce Tutorials

In Salesforce Home page we can add up to 20 custom components only.