The Process Builder is a workflow tool that helps you easily automate output generation. The Process Builder provides a user-friendly graphical representation of your process as you build it. With the Process Builder, you can:
- Create your processes using a convenient layout with point-and-click efficiency.
- Design an entire process in one place rather than using multiple workflow rules.
- Stop using Apex code to automate simple tasks.
Automated output generation in the Process Builder is based on records. The process consists of:
- Criteria that determine when to execute
- Immediate actions to execute when criteria are met
Any change that causes a record to match the criteria can automatically trigger output generation.
Note for System Administrators:
Process Builder and Docomotion Licensing
Each user who might trigger a Process Builder for generating output using Docomotion needs a Docomotion license. In organizations that purchased a Price Per Action (PPA) license, documents can be generated by users without a Docomotion license. However, in order to generate output, these users need to be assigned Docomotion Generator permission set.
Note that no error message appears if a document is not generated due to lack of a license.
For more information contact the Docomotion Support team.
Creating a New Process
To create a new process:
- Open the Process Builder (in Salesforce>Setup search for Process Builder), and click New.
2. Enter a name for the Process. The API name is generated automatically. You can also add a description.
3. From the process starts when select the relevant option (for example: A record changes).
4. Click Save.
Configuring the Process
To configure the process:
1. In the process flow diagram click Add Object.
2. From the Object dropdown list select the object whose change will invoke the process.
3. Select whether to start the process only when a record is created or when a record is created or edited.
4. When you finish click Save.
5. In the flow diagram click + Add Criteria.
6. In the Criteria Name text box enter a name for the criterion. You can also define the conditions. Or select No criteria just execute the actions (the name is compulsory even if no criterion is defined).
7. When you finish, click Save.
8. In the flow diagram click IMMEDIATE ACTIONS > +Add Action.
9. From the Action Type dropdown list select Apex.
10. In the Action Name text box enter a name for the action.
11. From the Apex Class dropdown list select one of the following:
- Generate Document: the output is generated to the specified channel in the selected format.
- Generate Link: A link to the output is sent to the Signer.
- Mail Body: The output is generated as an email body and sent to the specified recipient
- Mail Attachments: The output is generated in the selected format, attached to an email of the specified template and sent to the recipient.
The Set Apex Variables options change according to the Apex class you selected.
12. Enter the required values in the Set Apex Variables Type and Value columns.
|Apex Variable||Description||Type||Generate Document||Generate Link||Email Body||Email with Attachments|
|Format PDF, HTML, DOCX||The format of the generated output||string||√||√|
|Form #||Number of the Form to generate from. Should be the same object as the Generate on variable.||number||√||√||√||√|
|Generate on||Salesforce ID or The reference to the object that invokes the process (or its lookups)||Salesforce ID or
Reference to record ID (*)
|Channel – Document, Attachment, Chatter, File||The output channel for the generated output: Document, Notes&Attachments, Chatter File, File||string||√|
|Signer||The recipient of the email||Salesforce Contact ID
Reference to Contact record ID
|Use Active Version||Output can be generated also if the Form is in Active (not Published) state||boolean||√||√|
|Email Recipient ID||ID of the person to receive the output as an email||Salesforce Contact ID
Reference to Contact record ID
|Insert Template ID||ID of the Salesforce email template to which the output is added as an attachment.||
Salesforce Email Template ID
|File name/Subject||(optional) To add click Add Row and select the variable.||
(*)In the Value text box navigate to the record using lookups if needed).