You may find it necessary to include contact names on an invoice, packing slip, quote or contract. To accomplish this, you can add the following to the source of any template whose based object is either Opportunity or Account.
If you include the above snippet in your S-Docs template, the user will be prompted to choose a billing and shipping contact following the document selection step. The available Contact picklist is populated from the Contact Roles – so, you need to associate Contacts to the Account or Opportunity in order to use this template.
Optionally, you can include a generic contact record by using the syntax below. This may be more appropriate for custom objects. If you include the following, it will look for any link from your object to the Contact object and include those matching records.
Salesforce uses a standard “Contact Roles” object to relate contacts to Accounts and Opportunities. S-Docs leverages this existing functionality. If you need to specify an individual for other objects, you can extend the object with a custom field.