Automated DocGen Packages

Available only with Enterprise Edition

Use a workflow and an outbound message to automate generating documents. There are three high-level steps.

  1. You create a field in Salesforce that includes references to all the fields a user would manually select to generate documents.

  2. You create an outbound message and bind it to the field.

  3. You create a workflow that specifies when to send the outbound message.

    When the criteria for the workflow is met, the message is sent, automatically generating documents, which creates output and deliveries specified in the DocGen Package.

Note: Workflow/Apex DocGen Packages require the Enterprise Edition and the Workflow/Apex add-on. For more information, see Purchase, upgrade, or manage edition options.

Create a Salesforce field

You create a field in Salesforce that includes references to all the fields a user would manually select to generate documents.

To create a Salesforce field

  1. Navigate to a record on an object you want to use to generate documents and then select the View Fields link.

  2. On the Custom Fields & Relationships related list for the object you're working with, click New.

  3. In Data Type, select Formula and click Next.

  4. In Field Label, type Drawloop_Next.

    Note: You must use Drawloop_Next in Field Label. If you need to create more than one field, append a number or some other character, but always start the string in Field Label with Drawloop_Next.

  5. In Formula Return Type, select Text and click Next.

  6. Type the formula using these guidelines:

    • Append the letters SF to all object names.

    • Pass all relevant objects IDs.

      Note: You can find object Ids in the URL. For example, to find the Salesforce Id for a Delivery Option, navigate to the Delivery Option detail page and examine the URL. For more information, see Understanding the parts of a formula field.

    • You must specify a DocGen Package ID and deployment type.

    "SFobject_name__c:" & ObjectId & ";SFanother_object__c:" & AnotherId & ";DDPId:static Id;Deploy:staticid"
                        

    Where

    • SFobject_name__c the API name of the object the DocGen Package is based on with the letters SF appended to the front.

    • ObjectId a record Id from the object the DocGen Package is based on.

    • SFanother_object__c (Optional) the API name of another object with data you want to include in the DocGen Package with the letters SF appended to the front.

    • AnotherId (Optional) The record Id from another object you want to include in the DocGen Package.

    • DDPId:static Id The static Id of a DocGen Package

    • Deploy:staticId The Salesforce Id of a Delivery option.

      Note: Download Delivery option is not supported for Workflow DocGen Packages.

      Some delivery options take the DeployType parameter. If you use a delivery option that takes DeployType, use this syntax:

      Deploy:StaticIdDeployTypeValue

      For example, if you want to specify Salesforce email Delivery Option, it would look like this: 

      DeployType:autoemail;

      Delivery Option

      DeployType

      Salesforce email autoemail
      SMTP autosmtp

      HTTP Service

      autohttpservice

      Document Queue

      documentqueue

      DocuSign

      autodocusign

    Note: If your DocGen Package contains images or reports, see If your DocGen Package contains images or a report:

    nserted by the Insert Field function built into Salesforce.

  7. Click Next twice, and then click Save.

Create New Outbound Message

After you create the Drawloop_Next formula field, you must add the field to an Outbound Message that can send all of the necessary IDs to Nintex.

To create a new Outbound Message

  1. In Setup, click Create, click Workflow & Approvals and then click Outbound Messages.

    You may have to click Continue on Understanding Workflow.

  2. On All Outbound Messages, click New Outbound Message.

  3. From Object, select the object on which the DocGen Package you are trying to automate is based and click Next.

    For example, all the samples in this topic are based on the Opportunity object.

  4. On the outbound message configuration page, in Name and Unique Name, type a name.

  5. In User to send as, select a user.

  6. In Endpoint URL, type https://apps.drawloop.com/package/111

  7. Select Send Session Id.

  8. From Available Fields, select Drawloop_Next and click Add. Drawloop_Next is the field you created. It should appear in Selected Fields with Id.

  9. Click Save.

Create a Workflow Rule

After you create an outbound message, you must create a workflow rule that can trigger the outbound message.

To create a workflow rule

  1. In Setup, click Create, click Workflow & Approvals and then click Workflow Rules.

    You may have to click Continue on Understanding Workflow.

  2. Click New Rule.

  3. From Object, select the object on which the DocGen Package you are trying to automate is based and click Next.

    For example, all the samples in this topic are based on the Opportunity object.

  4. On the workflow rule configuration page, in Rule Name, type a name.

  5. In Evaluation Criteria and Rule Criteria, select the criteria you want to trigger the Outbound Message.

  6. Click Save & Next.

  7. In the workflow action editor, click Add Workflow Action and choose Select Existing Action.

  8. On Select Existing Actions, from Choose Action Type, select Outbound Message.

  9. From Available Actions, select the outbound message you created and click Add.

  10. Click Save.

  11. In the workflow action editor, under Action, confirm that your outbound message appears, and then click Done.

  12. On the workflow rule page, click Activate.

    Now, every time the criteria you set is met, the workflow is triggered, sending the outbound message and automatically generating the DocGen Package, using the formula field bound to the outbound message.