Conga Product Documentation

Welcome to the new doc site. Some of your old bookmarks will no longer work. Please use the search bar to find your desired topic.

Generate Invoice Lines Summary

generateInvoiceLinesSummary API is used to generate a summary of invoice line items for a set of invoices.

APISignature
generateInvoiceLinesSummarystatic (Set<Id> invoiceIds, String invoiceSummaryCriteria, Boolean isAsyncMode)

The summary groups invoice lines based on the specified criterion (like Charge Type, Start Date, Ship To, etc.) and calculates totals for each group, such as Fee Amount, Tax Amount, and Sub Total. The result is a map containing the summary data, which is then displayed in the Invoice Lines Summary related list on the invoice record.

When you call this API, it:
  • Creates a summary for invoice line items in draft or approved status.
  • Provides the ability to view the summary on the invoice records.
  • Displays the summary of invoice lines like a snapshot, allowing the user to merge this summary into the invoice document.
  • Allows the user to select a different summary criterion to re-create, merge, and send a new invoice summary based on customer requests.

Request

FieldTypeRequired?Description
invoiceIdsSetYesA set of Invoice record IDs for which you want to generate the summary lines.
invoiceSummaryCriteriaStringYesThe API name of the field to use as the summary criterion (e.g., Charge Type, Start Date, Price Type, Ship To, Location, or a custom field).
isAsyncModeBooleanNoIf true, the summary generation runs in batch (asynchronous) mode.

Response

FieldTypeDescription
mapinvoiceSummaryCriteriaMapmap containing the result of each processed invoice

Code sample

Set<Id> invoiceIds = new Set<Id>{'a5TDc00000161lG', 'a5TDc00000161lB'};
Map<String, Object> result = Apttus_Billing.InvoiceService.generateInvoiceLinesSummary(
 
invoiceIds, // Set of Invoice Ids
 
'AssetLineItemId__r.Apttus_Config2__ChargeType__c', // Criteria Name
 
true); // Boolean flag - If yes then batch mode will be executed otherwise sync mode will run
 
System.debug('================'+result);