Skip to main content
Conga Support

Match Leads to Contacts in a Reading Pane Tab

This scenario filters Contact records and only displays the matching ones in a Reading Pane tab. You can expand this to other objects as well.

The following image shows an example.

Follow these steps:

Create a Visualforce Page

  1. In Salesforce, click Setup.
  2. Click Develop and click Visualforce Pages.
  3. Click New.
  4. Enter a Label and Name. We suggest the following, where RP stands for Reading Pane:
    • Label: AG_Lead_Contact_Match_RPTab
    • Name: AG_Lead_Contact_Match
  5. Enter the following code in the Visualforce Markup area. 
    <apex:page standardController="Lead" showHeader="false" docType="html-4.01-strict">
    <script>
    $(document).ready(function() {
          crmc.require(["GridBase"], function(gridFactory) {
                 Object.each(gridFactory.instances, function(grid) {
                         if (grid.settings.pageInfo.objectName == "<filteredObject>"){
                             var filterFn = function(ds) {
                                   ds.filter({
                                        "logic": "and",
                                        "filters": [{
                                            "logic": "and",
                                            "filters": [
                                             {
                                            "field": "Email",
                                            "operator":"includes",
                                             "value": "{!Lead.Email}"
                                             }]
                                        }]
                                   });
                               };
                               var orig = grid.initDataSource;
                               grid.initDataSource = function(queryCallback, restoreColumns) {
                                     orig.apply(grid, [filterFn, restoreColumns]);
                               };
                               grid.refresh();
                            }
                     });
             });
    });
    </script>
    <br></br>
    This page matches contacts in the CONTACTS object by the LEAD.EMAIL address 
    <CRMC_PP:Grid ObjectName="Contact" FKName="" FKValue="" DelayLoad="false"  ViewID="a06o000000LFtBJAA1" 
     EnableNewButton="true"  EnableNewInline="true"  EnableEdit="true"  EnableActions="true"  EnableFieldChooser="true" 
     EnableStickyViews="true"  EnableToolbar="true"  EnableViews="true"  EnableFormatting="true"  EnableReadingPane="true" />
    <CRMC_PP:DrillUp />
    </apex:page>
  6. Click Save.

Load the Visualforce Page as a Reading Pane Tab

  1. Click ActionGrid Explorer.
  2. Select Lead from the object list.
  3. Click Reading Pane.
  4. In the row of tabs at the top of the Reading Pane, click the tab with the plus sign to display the Configure menu. This tab is at the end of the list; you may need to scroll through the tabs using the arrow icon.
  5. Click Reading Pane and click Visualforce Pages.
  6. Select the check box for Contact Matches. A Contact Matches tab appears in the Reading Pane.
  7. Click the Save View link in the ActionGrid toolbar. This will save your reading pane tabs so they will be available in a future session.

Generic Template

Use the following code to create your own Visualforce page with objects other than Leads and Contacts.

  • Replace <startObject> with the object that you are currently viewing.
  • Replace <filteredObject> with the related object you would like filtered in the reading pane.
  • Replace <filteredField> with the field name that will be matched to the <filteredObject>.
  • Replace <matchingField> with the field you would like to be matched.
<apex:page standardController="<startObject>" showHeader="false" docType="html-4.01-strict">
<script>
$(document).ready(function() {
      crmc.require(["GridBase"], function(gridFactory) {
             Object.each(gridFactory.instances, function(grid) {
                     if (grid.settings.pageInfo.objectName == "<filteredObject>"){
                         var filterFn = function(ds) {
                               ds.filter({
                                    "logic": "and",
                                    "filters": [{
                                        "logic": "and",
                                        "filters": [
                                         {
                                        "field": "<filteredField>",
                                        "operator":"includes",
                                         "value": "{!<startObject>.<matchingField>}"
                                         }]
                                    }]
                               });
                           };
                           var orig = grid.initDataSource;
                           grid.initDataSource = function(queryCallback, restoreColumns) {
                                 orig.apply(grid, [filterFn, restoreColumns]);
                           };
                           grid.refresh();
                        }
                 });
         });
});
</script>
<br></br>
Optional description 
<CRMC_PP:Grid ObjectName="<filteredObject>" FKName="" FKValue="" DelayLoad="false"  ViewID="a06o000000LFtBJAA1" 
 EnableNewButton="true"  EnableNewInline="true"  EnableEdit="true"  EnableActions="true"  EnableFieldChooser="true" 
 EnableStickyViews="true"  EnableToolbar="true"  EnableViews="true"  EnableFormatting="true"  EnableReadingPane="true" />
<CRMC_PP:DrillUp />
</apex:page>
  • Was this article helpful?