Merge Shipping and Billing Contacts Into Documents at Runtime

Introduction

Documents like invoices, packing slips, quotes, and contracts often need to include different points of contact for shipping and billing purposes. To accomplish this, S-Docs supports three different types of special contact merge fields in templates that use Opportunity or Account as their base object: Shipping contactsbilling contacts, and generic record contacts. When users generate documents that include at least one special contact merge field from one of these categories, they will be prompted to select one contact for each category included (shipping, billing, or record) whose information will be merged into the document. This article will explain how to use and configure these merge fields.

Include Shipping, Billing, & Record Contact Info

The following shipping, billing, and generic record contact merge fields can be included in your templates:

SHIPPING CONTACT MERGE FIELDS:
Shipping Contact Full Name: {{!PICKLIST.shippingContact.name}}
Shipping Contact First Name: {{!PICKLIST.shippingContact.firstname}}
Shipping Contact Last Name: {{!PICKLIST.shippingContact.lastname}}
Shipping Contact Email: {{!PICKLIST.shippingContact.email}}
Shipping Contact Phone: {{!PICKLIST.shippingContact.phone}}
Shipping Contact Title: {{!PICKLIST.shippingContact.title}}


BILLING CONTACT MERGE FIELDS:
Billing Contact Full Name: {{!PICKLIST.billingContact.name}}
Billing Contact First Name: {{!PICKLIST.billingContact.firstname}}
Billing Contact Last Name: {{!PICKLIST.billingContact.lastname}}
Billing Contact Email: {{!PICKLIST.billingContact.email}}
Billing Contact Phone: {{!PICKLIST.billingContact.phone}}
Billing Contact Title: {{!PICKLIST.billingContact.title}}


RECORD CONTACT MERGE FIELDS:
Record Contact Full Name: {{!PICKLIST.recordContact.name}}
Record Contact First Name: {{!PICKLIST.recordContact.firstname}}
Record Contact Last Name: {{!PICKLIST.recordContact.lastname}}
Record Contact Email: {{!PICKLIST.recordContact.email}}
Record Contact Phone: {{!PICKLIST.recordContact.phone}}
Record Contact Title: {{!PICKLIST.recordContact.title}}
Note: These merge fields can only be used in templates with the Related To Type field set to Opportunity or Account.

When users generate a document containing any of these special contact merge fields, they will be prompted to select contacts from a picklist before completing the document generation process. Fields from the chosen contact records will populate the corresponding merge fields in the document.

Note: These fields can also be used in signer profiles for S-Sign e-signature requests. Click here to learn more.

Let's take a look at this example Opportunity invoice template with shipping and billing sections.

We included three special contact merge fields for the shipping contact (highlighted in green) and three special contact merge fields for the billing contact (highlighted in blue). We also included two special contact merge fields for an alternative contact (highlighted in orange). When a user selects this template and clicks Next Step, they will be prompted with the following screen:

Since we included all three types of special contact merge fields, [1] one contact selection section appears for each type. To select a contact, users can [2] click the spyglass icon to look up any contact record available in their org. They can also [3] use the Contact Quick Pick to select from a list of all contacts related to the base record that the document was generated from. This list can be modified to include additional contacts as well; see configuration steps below.

Once a contact is selected for one of the contact types, their information will appear within that section.

[4] The shipping and billing contact selection sections also include the related account's shipping and billing addresses. Once all contacts have been selected, [5] clicking Generate Doc will complete the document generation process.

As you can see, the contact information was merged into the document:

Add Additional Contacts to the Contact Quick Pick

The Contact Quick Pick picklist allows users to easily choose any contact records related to the base record. You can also include contacts from additional objects, such as junction objects, within this picklist. This is configured at the template level.

To include additional objects, navigate to the template editor for the appropriate template, and then click over to the Advanced Options tab.

In the Advanced Options tab, scroll down to the Configure Contact Lookup section.

[1] The picklist lists each object whose contacts can be added to the Contact Quick Pick picklist. You can select multiple objects within this list. You can additionally extend objects with custom fields.

[2] If you would like to limit which contacts show up in this list, you can input a WHERE clause (omitting the WHERE) that dictates which contacts should appear in this list. Note that this query will affect the contact picker for special contact merge fields and the S-Docs Email page.

Tags: , ,

Was this helpful?