Each time a DocGen Package is ran you’d like the generated document to attach to a parent object. For example, each time XYZ Non-Profit generates a receipt for a Contact they would like the generated receipt document to attach to the Account record.
- Navigate to the DocGen Package and click the ‘New Insert-Update’ button.
- Set the Type drop-down to ‘Advanced’ to reveal additional fields on the page.
- Once the additional fields appear, set the Object Name drop-down to the parent object you would like to attach the generated document to. For our example we will use the Account object.
- Check-mark the Attach to this Object checkbox.
- Next, in the Field-Value Pairs drop-downs you will select the [Object] ID field. For our example the field is Account ID.
- In the empty text field enter the field tag for the object. Since our example is running from the Contact object and we would like to attach to the related Account field our field tag will be <<Contact_Account_Id>>. Below is our example Insert-Update:
- Lastly, navigate to your Delivery Option and ensure you check-mark the Allow Document Storage and Require Document Storage checkboxes. Additionally, select ‘Attachment’ in the Store As drop-down. Below is an example of our Delivery Option which will also email the generated document to the User’s email:
When you run the DocGen Package the document will now attach to the parent object.