Download PDF
Download page Determine Which Records to Include in Your Batch.
Determine Which Records to Include in Your Batch
When launching Conga Batch from the Conga Batch record, a Salesforce report or SOQL query is used to determine which Salesforce records are included in the batch operation. The report or query is also referred to as the “Master Object source". You might only use one Master Object source – either a report or a query, not both. However, queries tend to run faster than reports and work better with larger data tables.
Queries are faster and more reliable than Salesforce Reports.
Build a SOQL Query for the Master Object Source
Instead of a Salesforce report, you may use a SOQL query as the Master Object Source. Queries are typically used when reports are not available due to Salesforce security settings or if the desired records cannot be retrieved using a report. Just like using a report as the Master Object Source, Conga Batch uses this query to determine which records are included in the batch operation. The Salesforce ID of the Conga Query record will be referenced in the Query Id field under Master Object Source on the Conga Batch record.
Referencing a SOQL query as the Master Object Source requires the Conga Queries object. If you do not have this object installed in Salesforce, please contact Conga Support for assistance.
To build a SOQL query for the master object source:
- Create the Conga Query record.
- Give the record a Name and, optionally, a Description.
We recommend naming the query as "Conga Batch - [Name of Conga Batch Record]." Continuing with the same example, our name is "Conga Batch - Batch Simple Quotation" - Save the record.
- Ensure that the user who runs the Conga Batch solution has access to the Conga Queries object, the fields on the object, and the specific Conga Query record.
- Give the record a Name and, optionally, a Description.
- Launch Conga Query Builder to write the SOQL Select Statement.
- The base object you select when building your Master Object Source query must match the Master Object specified in the solution you converted into a Conga Batch formula field (see Convert a CQG Button into a Formula Field for further details).
- In other words, if you built your solution with the Quote as the Master Object, the base object for your Master Object Source query for Conga Batch will also be Quote.
The Conga Batch formula field is located on the Master Object. This Master Object must be selected as the base object (the “FROM” object) in the query. If you reference ANOTHER object in the Where clause, Conga Batch cannot handle this level of complexity.
- Select the Master Object ID as the first field in the query.
- This is the only field that is required for Conga Batch to read the query and determine which records to include in the batch.
- You can include other fields in the query to assist in your reading of the query (like a name field) as desired, keeping in mind that the fewer fields included on the query, the faster it runs.
- Define the selection criteria of the query so that the proper records are included in the batch.
- You can also choose a sort order and limit the number of rows as needed.
Optimize the processing time of your query and the overall speed of the Conga Batch solution by using simple filters whenever possible. The operators “equals,” “contains,” and “starts with” minimize the possibility of a timeout.
- Confirm the accuracy of your SOQL statement and Save it. Ensure that the Master Object ID (typically, “Id”) is included as a field in the SELECT clause, that your filter criteria in the WHERE clause are correct, and so forth.
Build a Report for the Master Object Source
We need to create a Salesforce report that contains a list of Master Object IDs. Conga Batch will use this report to determine which records are included in the batch operation. The Salesforce ID of this report will be referenced in the Report Id field under Master Object Source on the Conga Batch record.
To build a report for the master object source:
- Create a new Report folder called Conga Batch Reports. This folder is used in a later step to house the Master Object Source Report.
- Clear the High Assurance Session Required setting to allow and Conga Batch to access exported report data. Do this from Setup → Customize → Reports and Dashboard Settings → Access Policies.
Note: If this setting is enabled, the session security level required to export reports is increased, preventing and Conga Batch access to the report data. - Ensure that the Conga Batch Reports folder is accessible by the users who will run the Conga Batch solution.
- Choose the Salesforce Report Type that matches your master object. The Report Type you select when building your Master Object Source Report must include the same object type as the Master Object specified in the solution you converted to Conga Batch (see Convert a CQG Button into a Formula Field for further details). For example, if you built your solution with the Quotes as the master object, your Master Object Source Report Type for Conga Batch must also include Quotes.
- Include the Master Object ID as the first (far left) column on the report.
- This is the only field that is required for Conga Batch to read the report and determine the records included in the batch.
- You can include other fields as columns on the report to assist in your reading of the report (ex: a name field) but the first ID column encountered (as read left-to-right) must be the column of Master Object IDs (see image below). Keep in mind that the fewer fields included on the report, the faster it runs.
- Define the filter criteria of the report so that the proper records are included in the batch (for example, Time Frame or Quotation Status).
- Optimize the processing time of your report and the overall speed of the Conga Batch solution by using simple report filters whenever possible. The operators “equals,” “contains,” and “starts with” minimize the possibility of a timeout.
- Save the report in the Conga Batch Reports folder.
- We recommend naming the report as “Conga Batch - [Name of Conga Batch Record].” Using our previous example, our report name is “Conga Batch - Batch Simple Quotation”.