Skip to main content

How to create a custom button to open Visualforce page

Let's say that you are working in a large Org and different groups throughout the company use the same object, but each a little differently. Instead of overriding the standard "Edit" or "New" buttons, create a custom button.

For example, there is a custom object on the standard Opportunity object and you want to launch a different page layout for your sales team for a custom quoting object.


  1. Create your "Quote" Visualforce page.
  2. Create the custom button on the custom object.
    • Label: New
    • API Name: New_Quote
    • Type: List Button
    • Content Source: OnClick JavaScript
    • Behavior: Execute JavaScript
    • Button or Link URL:
      • window.open("/apex/InputVisualforcePageNameHere?RecordType=InputRecordTypeIdHere&retURL={!Opportunity.Id}&cancelURL={!Opportunity.Id}&saveURL={!Opportunity.Id}","_parent");
  3. Edit the Opportunity page layout for the sales team and modify the buttons on the related list to add your custom button.
In order to be able to edit the record with the Visualforce page layout too, you will need to create a Detail Page Button on the custom object.

Simply...
  1. Create the custom button on the custom object.
    • Label: Edit
    • API Name: Edit_[InputVisualforcePageNameHere]
    • Content Source: Visualforce Page (Quote)
    • Behavior: Display in existing window with sidebar
  2. Add the custom button to the sales team's page layout for the custom Quote object.

Comments

Popular posts from this blog

Replace the Salesforce.com logo with a company logo

Having the Salesforce.com logo in the top left of your Org can make it feel like you are using a tool that is not built for your company. Fortunately, there is an easy way to brand your Org with your company's logo. Follow these simple steps: Import the company logo Go to All Tabs > Documents. Select the "Documents" object and the "New" button. The document name will be something like "CompanyLogo.jpg". Set "Externally Available Image" as TRUE. Choose to place the record in either a custom Admin folder to separate from other document files or place it in your "My Personal Documents". Upload the file from your computer. I recommend that the image you attach be 200 pixels width, 45 pixels height, and no more than 20KB in size. Try to use an image with a transparent background since SFDC's background uses a gradient color scheme. Save. Create a custom App Go to Setup > Build > Create > Apps. Select

How to Format Number or Currency Values in Conga (Word)

Formatting Number Values The number formatting parameter begins with \#, followed by any combination of the following parameters.  Please see the examples following this table. When Conga Composer populates a numeric value, the digit grouping symbol (the “thousands separator”) is defined according to your Locale settings (as defined in Salesforce’s Setup | Personal Information) or according to the Culture or CurrencyCulture Conga Composer parameter. Despite the cultural settings that govern the output from Conga Composer, within an appearance parameter, you must use a comma (",") for the digit grouping symbol (for thousands) and a period (".") as the decimal symbol. ​   PARAMETER DESCRIPTION 0 (zero) Specifies the requisite numeric places to display in the result. If the result does not include a digit in that place, Word displays a 0 (zero). Example: { = 4 + 5 \# 00.00 } displays "09.00". # Specifies the requisite numeric places to display in the r