DocumentationCenterpoint for SalesforceBatch sending

Batch sending

Batch sending sends one on-demand letter to many contacts or person accounts, or from a Flow, without opening the editor. Each recipient becomes a print order, and a background job creates and distributes the documents one by one.

Note: The two bulk send pages in the package are in Swedish only. This page gives the Swedish label first and its meaning after it.

Send to selected contacts

  1. Open a Contact list view in Salesforce and select the contacts you want to send to.
  2. Click Batch Distribute Document. If the button is missing, an administrator adds it to the list view buttons of the Contact object in Setup.
  3. The page Skicka brev till kontakter (Send letter to contacts) lists the selected contacts with their e-mail address and a Preview link that opens the PDF for that contact.
  4. In Välj mall (Choose template), choose the template. The list shows each template’s description.
  5. In Välj distribitionsmethod (Choose distribution method), choose the distribution method.
  6. Click Skicka (Send).

The page confirms with N print orders created and batch send started, where N is the number of contacts. The button then stays disabled, and Avbryt (Cancel) changes to Close.

For person accounts, use the Person Batch Distribute Document button on the Account list view. It works the same way on the page Skicka brev till personkonton (Send letter to person accounts).

Who can send, and which templates are offered

  • The Metaforce Bulk Send setting decides who may send in bulk. A user who may not sees Du har inte tillåtelse att göra massutskick. Kontakta din administratör för Salesforce. (You are not allowed to send in bulk. Contact your Salesforce administrator.) When no setting exists at all, bulk sending is allowed. See Configuration.
  • Only templates with the keyword USERSELECTABLE and without an editing process are offered. A template with an SOBJECT keyword must include Contact, or PersonAccount on the person account page. Templates without the keyword are offered on both pages.

Follow the job

Open the PrintOrders and Batch Logs tabs. They are part of the Metaforce Demo app, or you can add them to your own app.

PrintOrders has one row per recipient. The Status of a row is Waiting, Done, Error or Prohibited, and Typ (Type) is Manual or Batch. A row with the status Error keeps the error text in its ErrorLog field. Some field labels on this object are in Swedish, for example Mall for template and Utskrivet for the print time.

Batch Logs has one row per job run. Its fields include Batch Type, Batches, BatchSize, Job Status, Records Processed, Records Processed / min, Execution Time (minutes) and Log detail.

The job takes the print orders of type Batch with status Waiting, in groups of 4 at a time. When Auto Batch Size is on in Metaforce Print Batch Control, the job adjusts the group size to the Salesforce limits it meets while running. See Configuration.

Start from a Flow

A Salesforce Flow can create print orders and start the job. In Flow Builder, add the action Create Batch Print Job to a flow. It has these inputs:

InputMeaning
Salesforce Record IDThe record to create the document for
SObject NameThe name of the Salesforce object, for example Contact
Template NameThe name of the template
Print TypeBatch or Manual
Metafile NameTypically Salesforce
Distribution MethodTypically Archiving
DataServiceName of the data service, typically DEFAULT
ClassificationThe classification, or empty
XML DataData to use in the template

The action creates one print order for each request with the status Waiting, and then starts the print job. The job only picks up print orders of type Batch, so set Print Type to Batch for the document to be sent.

From Apex

Code can start the job with startPrintOrderBatchJob in the Editor Apex API.