A List View button that allows an end-user to dynamically select the child records they want to include in a Conga Composer operation using checkboxes.

Javascript is not supported in Salesforce lightning. Using a Javascript button is not currently a feature available to use in the 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 build a List View button that allows the end-user to dynamically select the child records they would like to include in a Conga Composer operation using checkboxes.

To create a list button on the child object:

  1. Change your button settings to Display Type- List Button. Display Checkboxes (for Multi-Record Selection) should be checked.
    • Behavior – Execute JavaScript
    • Content Source – OnClick JavaScript
  2. Copy the below text and paste it into your button. Be sure to update the Object Type in the first line to the Child Object that is the same Object as the Object your list button is on. Also, change the field in the seventh line to the Parent ID of the Object your button is on. 

    var ids= {!GETRECORDIDS( $ObjectType.OpportunityLineItem )};var idsReport=ids.join("|");var
    idsQuery=ids.join("'|'");https://composer.congamerge.com" +"?sessionId={!$Api.Session_ID}" +"&ServerUrl=
    {!$Api.Partner_Server_URL_80}" +"&Id={!Opportunity.Id}" + "&ReportId=00OE0000000P57r?pv0=" + idsReport
    +"&QueryId=a03o000000JuspY?pv0='" + idsQuery +"'";window.open( CongaURL, "Conga",
    "width=700,height=550,menubar=0" );

  3. Create a query with all of the child fields you want to include. The WHERE clause should be the Child ID updated to IN ({pv0})
    • Example Query for Opportunity Product: SELECT Description, ListPrice, Product_Family__c, Quantity, UnitPrice, TotalPriceFROM OpportunityLineItemWHERE Id IN ({pv0})
  4. Add button to layout.
  5. Edit the Parent Object Page Layout. In edit mode go to your child related list and click Properties (the tool icon).
  6. Open the button options at the bottom of the pop-up, add the button and save.