Skip to main content
Conga Support

Create Buttons for List Views and Search Results

Follow these steps:

  1. In Salesforce®, click Setup.
  2. In the App Setup section, Click Customize.
  3. Click the drop-down arrow for the object you want to customize.
  4. Click Buttons, Links, and Actions.
  5. Click New Button or Link.
  6. Populate the fields as follows:
    • Label: ActionGrid
    • Name: crmc_Grid
    • Display Type: List Button
    • Display Checkboxes (for Multi-Record Selection): Enabled
    • Behavior: Execute Javascript
    • Content Source: OnClick JavaScript
  7. Copy and paste the following code into the Content section, modifying the object name as needed.
    (function (objectName, selectedIds) 
    { var head = document.getElementsByTagName('HEAD').item(0); 
    var script = document.createElement("script"); 
    script.type = "text/javascript"; 
    script.onload = function () 
    { GridButton.showInGrid(objectName, selectedIds); 
    script.src = "/resource/crmc_pp__gridbutton?ts=" + new Date().getTime(); 
    }("<Object Name>", {!GETRECORDIDS( $ObjectType.<Object Name>)}));
  8. Click Save.
  9. In Salesforce Setup, click the drop-down arrow again for the object you want to customize.
  10. Click Search Layouts.
  11. Click Edit next to object List View or Search Results, depending on where you want to manually add the button.
  12. Follow the steps in ActionGrid Buttons.

If you are adding a button for a related list (instead of having an embedded ActionGrid℠), populate the ForeignKeyName and ForeignKeyValue fields using the example below. This example shows Contacts for an Account page layout.

(function (e,t)
{var n=document.getElementsByTagName("HEAD").item(0), r=document.createElement("script"); 
r.type="text/javascript", n.appendChild(r), r.onload=function(){GridButton.showInGrid(e,t,'AccountId','{!Account.Id}')},r.src="/resource/crmc_pp__gridbutton?ts="(new Date).getTime()}
("Contact", {!GETRECORDIDS( $ObjectType.Contact)}));

Here is the generic code:

(function (e,t)
{var n=document.getElementsByTagName("HEAD").item(0), r=document.createElement("script");
r.type="text/javascript", n.appendChild(r), r.onload=function()
r.src="/resource/crmc_pp__gridbutton?ts="+(new Date).getTime()}
("<ChildObject>", {!GETRECORDIDS( $ObjectType.<ChildObject>}));