Overview

When generating output, you can automatically include in the output, during generation, PDF and HTML documents from Salesforce. See Generating Output through the Generate Document Button.

You can add documents from one of the following sources:

  • Document object
  • Files available in libraries

You can add the documents to a form or to a record.

If you want to add documents to an object’s record you need to add the Include Additional Documents lookup to the object’s page layout. This custom lookup is provided OOTB in the following objects: Account, Case, Contact, Lead, Opportunity. In other objects, you need to add the lookup to the object.

The Form object’s layout includes this custom lookup by default.
When using Salesforce Lightning you also need to add the New button to Include Additional Documents in the layout of the object.

Adding Documents to a Form

To add documents to a form:

  1. In the Forms tab select the form to which you want to add documents.
  2. Scroll down to Include Additional Document and click New.
  3. Click the search icon to display a list of available documents for this form.
  4. Select Documents to display documents from the Document object and Files to display files from libraries.
  5. Click the document you want to add to the form. The document is displayed in the Document File Name field.
  6. In the Display order field add the default order of the document when added to the output (you can change the order when generating output).
  7. You can check the Required box to designate the document as required. In this case, the document will be added to the generated output and the output generator cannot remove the document from the generated output.
  8. Click Save.

Adding Documents to an Object’s Record

You can add documents to a record if the Object that was configured to include additional documents. (see Configuring Objects to Include Additional Documents).

Documents added to records cannot be designated as required.

To add documents to a record:

  1. In the tab of the object select the record to which you want to add documents.
  2. Scroll down to Include Additional Document and click New Additional Document.
  3. Click the Search icon to display a list of available documents for this object.
  4. Select Documents to display documents from the Document object and/or Files to display documents from libraries.
  5. Click the document you want to add to the record. The document is displayed in the Document File Name field.
  6. In the Display order field add the default order of the document when added to the output (you can change the order when generating output).
  7. Click Save.

Adding the Include Additional Documents Section to the Page Layout

To add documents to an object’s record, the page layout of the object needs to include the Include Additional Documents section.

To add the Additional Documents field to the page layout of an object:

  1. Access the object’s page layout through a record of the object to which you want to the Additional Documents section (for example, select a Contact record and go to Edit Layout).
  2. Select Related Lists in the left pane.

  3. Find Additional Documents and drag and drop to the required location.
  4. Click Save.

Add Lookup from Additional Documents to an Object

To add documents to the object you need to add the Additional Documents custom lookup to the Object.

The following Salesforce Objects: Account, Case, Contact, Lead, Opportunity include the Custom Lookup by default.

For other objects, you need to add Lookup from Additional Documents to the Object.

To add Lookup from Additional Documents to an Object’s layout:

Note: We will add the lookup to the Order object.

  1. Go to the Additional Documents object: Custom Fields &Relations (these lookups exist by default for OOTB objects).
  2. Click New.
  3. Select Custom Relations.
  4. Select the object to which you want to add the lookup (in our example: Order).
  5. Click Next.

  6. Click Next: The lookup to the new object (Order) now appears in the list.

(In Salesforce Lightning Only) Add the New button to the Include Additional Document Layout

When using Salesforce Lightning you also need to add the New button to Include Additional Documents in the layout of the object.

To add the New button:

  1. In the Include Additional Document section of the page layout, click the setup icon .

    The Related List Properties – Include Additional Document window is displayed.
  2. In the Buttons tab>Custom Buttons, from the Available Buttons pane select New and add to the Selected Buttons.
  3. Click OK.

The New button is added to the layout.