Loading
Prepare for Email to Become the Default Login ExperienceRead More
Extend Salesforce with Clicks, Not Code
Custom Button Example: Pass Record IDs to an External System

Custom Button Example: Pass Record IDs to an External System

You can use Salesforce record IDs as unique identifiers for integrating with an external system. This example creates a button that calls a Visualforce page to determine the record IDs of selected records and passes them in a URL query parameter to an external Web page called www.yourwebsitehere.com.

Required Editions

Available in: Salesforce Classic

Custom buttons and links are available in: All Editions

Visualforce pages and s-controls are available in: Contact Manager, Group, Professional, Enterprise, Performance, Unlimited, and Developer Editions

User Permissions Needed
To create or change custom buttons or links: Customize Application
  1. Create a Visualforce page that uses the GETRECORDIDS function to retrieve a list of selected records:
    <script type="text/javascript">
    
    idArray = {!GETRECORDIDS($ObjectType.Account)};
    
    window.location.href="http://www.yourwebsitehere.com?array="+idArray;
    
    </script>
    Note
    Note Replace www.yourwebsitehere.com with your own URL.
  2. Define a button for accounts with these attributes.
    Display Type List Button

    Select Display Checkboxes (for Multi-Record Selection) so users can select multiple records in the list before clicking the button.

    Behavior Display in existing window with sidebar.
    Content Source Visualforce page.
  3. Select the Visualforce page you created in the first step.
  4. Add the button to the appropriate page layout or list view layout.
 
Loading
Salesforce Help | Article