Skip to main content
Conga Support

Create a Conga Composer 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 integrate Conga Composer with Salesforce Classic, Lightning and SF1. 


Integration Method

You can integrate Conga Composer within Salesforce Lightning using the following steps:

1. Create a Visualforce page with a set controller.

2. Create a new button and select Visualforce for type. Enable Display checkboxes (for Multi-Record Selection) and select Visualforce Page as the Content Source. 

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

From Step 1, your Visualforce page should look like this:

<apex:page standardController="Opportunity" extensions="OpportunityCMController" recordSetVar="opportunities" action="{!prepareCMUrl}">
    <apex:outputPanel id="script">
        <script type="text/javascript">
            window.open("{!CMUrl}","_blank","width=640,height=480");
            window.history.back();
        </script>
    </apex:outputPanel>  
</apex:page>

And now the Apex class :

public class OpportunityCMController {
    private final static String urlFieldName = 'Conductor__c';
    private String partnerServerUrl;
  private ApexPages.StandardSetController controller;
    private List<String> opportunityIds = new List<Id>();
   
    public String CMUrl {get; private set;}
   
    public OpportunityCMController(ApexPages.StandardSetController controller) {
        this.controller = controller;
       
        for (Opportunity opportunity : (List<Opportunity>)controller.getSelected()){
            opportunityIds.add(opportunity.Id);
        }
       
        partnerServerUrl = 'https://'+ApexPages.currentPage().getHeaders().get('Host')+'/services/Soap/u/26.0/'+UserInfo.getOrganizationId();
    }
   
    public PageReference prepareCMUrl() {
        CMUrl = 'https://composer.congamerge.com' +
        '?SessionId=' + UserInfo.getSessionID() +
        '&ServerUrl=' + partnerServerUrl +
        '&Id=' + UserInfo.getUserId() +
        '&QueryId=[Opps]a0346000009N2DH?pv0=' + '\''+ String.join(new List<String>(opportunityIds),'\'|\'')+'\'';
    
        
        return null;
    }
}

Sample Query Dataset:


   select name, amount, stagename from opportunity where id IN ({pv0})