Salesforce and Application Integration > Launching a Guide > Launching a Guide from a Salesforce Button
  

Launching a Guide from a Salesforce Button

The previous topics in this section showed how you can add a button to a page and have that button launch a guide. In some cases, you want a guide to launch when a user presses a button. For example, within an Account page, pressing the "New Opportunity" button tells Salesforce to display an empty Opportunity page. This topic shows how you could instead launch a guide when the user presses the button.

Step 1: Create a Visual Force Page

  1. 1Select Setup > App Setup > Develop > Pages. At the top of the table that is displayed, press the New button.
  2. 2Enter the label that will be used for your code. Salesforce will also automatically give it a name. You can give it another name if you like.
  3. 3Add your code to this form. The following code is designed to modify the Salesforce built-in Opportunity object. It will invoke a guide called "New Opportunity". As it will be invoked from within an Account page, the objectType is set to Account. The opportunity will need to know the AccountId (which is the same as when the form is displayed when pressing the New button). The final attribute indicates the guide will display in an area whose height is 600 pixels.
  4. <apex:page standardController="Opportunity">
    <icrt:AeSalesGuides
    guideName="New Opportunity"
    objectType="Account"
    objectId="{!Opportunity.AccountId}"
    height="600px"/>
    </apex:page>
  5. Visualforce Markup

Step 2: Reassign the "New" Button

  1. 1Select Setup > Customize > Opportunities > Buttons, Links, and Actions.
  2. 2In the displayed table, select the Edit Action to the left of New.
  3. Selecting Edit
  4. 3In the displayed Override Properties page, go to the bottom of the form and set Visualforce Page. From the picklist, select the name of the Visualforce page This is the name you set in the previous section.
  5. Setting Override Properties
  6. 4Press the Save button.

Step 3: Test that the Guide is Launched

  1. 1Open a page for an existing account.
  2. 2Scroll down the Opportunities area, then press New Opportunity. The New Opportunity guide should launch.