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.
Now go to Stage and Edit as shown below.
Now go to Opportunity Stages Picklist=>Prospecting.
Select Edit Button as shown above.
Enter 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.
Now Select New.
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.
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.
Select New Button.
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]
After Creating Visualforce we have to set some security settings for the profiles in our organization.
Now go to Visualforce page=> Select Security.
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.
Now enter Name as Opportunity sales stage and select Type as HTML area.
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.
Now select Opportunity Sales Stage check box to enable on home page.
Select Next button and now move he fields to your required position.
Now Save.
Go to to your Home page and you will find Opportunity sales stages as shown below.
In Salesforce Home page we can add up to 20 custom components only.