Docomotion uses a custom button in a Salesforce Object, named Generate Document, in order to generate an output from a Salesforce Object. This button retrieves all Standard and Custom fields in the Object so that they are available to merge into a Form you designed.

The Document Generation screen is Lightning Ready.

The Generate Document button also retrieves data from Related Objects: Lookup fields (1 to 1 relation) and other Related Objects in Salesforce (called in Docomotion Children), which are presented as a table in the output document.

The Object where you place your button is called the Main Object.

For information on how to set up the Generate Document button refer to Configuring the Generate Document Button.

Salesforce end-users can click the Docomotion Generate Document custom button from a Salesforce record. This merges data from the record and the related objects into the selected Form, resulting in an output document populated with data from that specific Salesforce record and its related records.

The maximum size of an output file (including attached documents and pictures) in 6 MB for synchronous generation and 12 MB for asynchronous generation.

Adding Documents to the Generated Output

It is possible to include in the generated output additional PDF and HTML documents. The documents can be, according to the default generation settings of the Form, either from the Salesforce files added to the record or files and documents  added to the Include Additional Documents object (see Using Salesforce Documents and Files in Generated Output) .

You cannot include additional documents if the output format is Mail Body.

Documents can also be added to the form as Required, this means that when generating output, these documents will automatically be added to the output and cannot be removed. For example, if Sales reps must include Terms&Conditions in each quote sent from Salesforce, this document can be added as Required to the Forms of the Quote object. Documents added to records cannot be designated required.

Output Channels

There are several available output channels:

  • Mail: Send email with the output as an attachment (automatically selected if you chose Mail Body Format). When selecting the Mail output channel, authorized output generators can select as the body of the email an email template. The templates list displays all email templates residing in the Docomotion Emails folder.
  • Download: Download the document to your local workstation
  • Document: A Document Object is created in Salesforce.
  • Notes and Attachments: The output is added to the Object record feed.
  • File: The output is stored in Files and can be seen in the related list of the record.
  • Chatter File: The output is added to the Chatter info and stored in Files.
  • Link: See Link Output Channel.
  • Google Drive (optional): Save the output to Google Drive. To save the output to Google Drive you need to configure Docomotion to work with Google Drive. See configuration Docomotion to Work with Google Drive.

The information and options in the Document Generation window depend on the default generation settings for your role. See Defining the Default Form Generation Settings.
You can restrict the access to all or some Form records and provide access permissions to specific organizational users. Users will only see Forms they are authorized to access. See Restricting Access to Forms / Sharing Settings.

To generate output you can use Chrome, Firefox, or Internet Explorer version 10 or above.

To generate documents:

1.  In Salesforce, select a record from which you want to generate a document.

You can add HTML and PDF documents to the generated output. See Using Salesforce Documents and Files in Generated Output.

This option does not support tagged PDFs.

The Additional Documents pane displays the documents that can be added to the generated output in the order according to their definition (For documents from the Include Additional Documents object, documents from the Form precede, by default, documents from the record) , and the documents that are defined as required for the Form(with a red icon). Use the right/left arrows to add/remove documents and the up/down arrows to change the order by which the documents are added to the output. Note that the generated output and documents defined in the Form as required cannot be removed. You can, however, change their default order.

2.  Click Generate Document. See Configuring the Generate Document Buttons.

3. Select the Form from which you want to generate documents (if the Form is not in Recent Items view, select All and click Go to display all Forms of the Object).
The Document Generation screen displays all Forms published/activated for the Main object.


  • Users with Docomotion Admin or Designer permission sets will see both active and published forms.
  • Users with Docomotion Generator permission set will see only the published forms without the Status column.

You can now click Show Template to view the template which is a Form without the data or Preview Document which results in an output (in PDF format) with data retrieved from the database based on the Form design.

Note on the generation / preview / view of PDF:

You might get the PDF in two ways depending on your browser settings:

  • Downloaded version inside the browser.
  • Immediately display the document inside the browser. In the following settings: chrome browser type:   chrome://plugins/ Enable chrome PDF viewer.

4.  In the case of Forms with Interactive Collection tags, or when selecting an email output channel or Mail Body format, you also need to select a recipient.

5.  Select the Output Format:

  • PDF
  • HTML
  • Docx (not available for Interactive Forms)
  • Mail Body (not available for Interactive Forms, since most email clients block JavaScript needed for submitting interactive data)

If you select Mail Body output format and the Additional Recipients option is enabled in your organization, you can add recipients to the email using lookups.

When you select the Mail Body output channel the Select Recipient pane is displayed.

a. From the Lookup dropdown list select the required Lookup.

b. From the Name dropdown list select the recipient.

6.  Select the Output Channel:

  • Mail: send an email with the output as an attachment (automatically selected if you chose Mail Body Format).
    The templates list displays all Salesforce templates residing in the Docomotion folder. See Using Email Templates.
    When generating output from a Custom Object using the email output channel, you need to edit the Custom Object and enable the following optional features:
  • Download: download to your local workstation
  • Document: create a Document Object in Salesforce.
  • Notes and Attachments: add to the Object record feed
  • Chatter: add to the Chatter info.
  • Link: See Link Output Channel. When you select Link, the Mail Output Channel is selected and the HTML Output Format is automatically selected.
  • Google Drive (optional): If Google Drive is configured, the Output File Name box displays the default Google drive directory. You can click Browse to a different location of the Google Drive.
To save the output to Google Drive you need to configuration Docomotion to Work with Google Drive.

7.  In the Output File Name box leave the file name set in the Generation Settings section or change the name of the output file. By default the file name is the record name unless defined otherwise in the Generation Settings.

The following characters are not permitted in the file name and will be replaced by by underscore _: # % ^ < > { } [ ] \ | ~ ‘. A space in the file name is replaced by a hyphen .
If you selected the Chatter or Notes & Attachments output channel, you cannot use special characters in the file name as this generates a 4002 error.

8.  Click Generate; the documents are generated in the format and output channel you selected.

For details regarding the target of the generated output and what you can do with it, see Handling and Reviewing the Generated Output.