Skip to main content
We like the concept of Sales Coach, however we'd love to extend that capability to other fields/objects and other solutions we have built into Salesforce. Is it configurable? Has anyone modified it to work beyond Opportunity Stage? This could be so effective as Custom Help, driven by field values selected by the user.
4 risposte
  1. 9 set 2011, 21:02
    You would have to modify the opportunity query in the constructor to query the fields you want to add, then add a save function

     

    Example modification to the constructor

     

    public SalesCoachControllerV2() {

           String ID = ApexPages.currentPage().getParameters().get('id');

          try{ 

            this.oppty = [select 

                                 id, 

                                 name,

                                 StageName, 

                                 forecastcategory,

                                 CloseDate,

                                 Term__c, ---------add whatever Other Custom fields you want

     

    Then put them in the vf page.

     

    And to create your own save button, add a button within vf and add this logic

     

    <apex:commandbutton action="{!Save}" value="save"/>

     

    public pagereference Save(){

           try{

               oppty.stagename = opportunityStage;

               update oppty;

                

               PageReference opptyPage = new ApexPages.StandardController(oppty).view();

               opptyPage.setRedirect(true);

               return opptyPage;

     

           }catch(exception e){

               ApexPages.addMessage(new ApexPages.message(ApexPages.severity.Error,'An error occured while updating: '+e.getmessage()));

               return null;

           }     

        }

     

    Good Luck!
0/9000