Skip to main content
Conga Support

Create a Conga Batch List View Button (Lightning Experience)

  Conga cannot support customized code. Due to the complicated nature of supporting programmers and programming languages, the integration of Conga with Visualforce, Apex, and Javascript (or other programming languages) is not supported.

You can use Conga Grid to integrate Conga Batch with Salesforce Classic, Lightning and Salesforce One (SF1). 

Before you begin

You must have created a Conductor and Batch formula record. For more information see the Conga Batch Product Guide.

Alternative integration method

You can integrate Conga Batch within Salesforce Lightning.

1. Create a Visualforce page with a set controller.

2. Create a new button of type Visualforce. Enable Display checkboxes (for Multi-Record Selection) and selecting Content as the Visualforce page. 


 3. Add the newly created button to the list in Search Layouts.


From Step 1:

This example demonstrates how the code is setup for a List View Button on the Account Object. If you are using a different Object, the Standard Controller value in the Visualforce Page should reflect that Object.

  1. Create your Controller Extension (Conductor__c assumes you have created a formula field on object already). Note the placement and reference of the Conductor__c formula field below. 
* @description Builds list of sObject Ids from recordSetVar and constructs the Conductor URL
public class ConductorFromListViewController {
  private final static String urlFieldName = 'Conductor__c';
  private String partnerServerUrl;
  private ApexPages.StandardSetController controller;
  private List<Id> recordIds = new List<Id>();

  public ConductorFromListViewController(ApexPages.StandardSetController controller) {
    this.controller = controller;
    for (sObject sObj : controller.getSelected()){
    partnerServerUrl = 'https://'+ApexPages.currentPage().getHeaders().get('Host')+'/services/Soap/u/26.0/'+UserInfo.getOrganizationId();

  public PageReference prepareConductorUrl() {
    PageReference conductorUrl = new PageReference('');
    conductorUrl.getParameters().put('MOID', String.join(new List<Id>(recordIds),','));
    conductorUrl.getParameters().put('SessionId',  UserInfo.getSessionID());
    conductorUrl.getParameters().put('ServerUrl',  partnerServerUrl);
    conductorUrl.getParameters().put('UrlFieldName',  urlFieldName);

    return conductorUrl;

2. Create a Test Class.

* @description Test Class for the ConductorFromListViewController Class
public with sharing class ConductorFromListViewControllerTest {
    * @description setup - test data setup method
    public static void setup(){
        List<Account> testAccounts = new List<Account>();

        Account a = new Account();
        a.Name = 'ABC Company, Inc.';

        Account acct = new Account();
        acct.Name = 'XYZ Company, Inc.';

        insert testAccounts;
    * @description testMethod1 - Test Happy Path of code
    public static testMethod void testMethod1() {
        List<sObject> accts = (List<Account>)[Select Id From Account];
        ApexPages.StandardSetController ssc = new ApexPages.StandardSetController(accts);
        ConductorFromListViewController cn = new ConductorFromListViewController(ssc);
        PageReference pr = cn.prepareConductorUrl();
        String fieldName = pr.getParameters().get('UrlFieldName');
        System.assertEquals('Conductor__c',fieldName, 'The UrlFieldName parameter is not set' );

3. Create a Visualforce Page   

<apex:page standardController="Account" extensions="ConductorFromListViewController" recordSetVar="records" action="{!prepareConductorUrl}">

According to Salesforce, you cannot create a new Apex class in a Production environment. You should be able to create a new class in the Sandbox org and publish that org updated to your Production Org. To learn more, see Create Apex classes in a production organization.