Apex Data Relationships

Use Apex Data Relationships to use your own code to collect and process data before adding it to your DocGen Package A customizable package that consists of your Salesforce data, documents, and delivery configurations for documents you want to generate.. Nintex provides a programming interface for creating Apex Data relationships Salesforce says, "A connection between two objects, used to create related lists in page layouts and detail levels in reports.".

Nintex provides samples to help you get started with developing Apex Data relationships. Get the code here. You can use the developer console to implement the SampleDrawloopApexData1SFObject Apex class in Salesforce to create an Apex Data relationship in a DocGen Package.

Create an Apex Data Class

  1. Log into your Salesforce and open the Developer Console.
  2. From the Developer Console, create a new Apex class named SampleDrawloopApexData1SFObject.
  3. Paste the contents of the sample file (SampleDrawloopApexData - 1 Sf Object.java) into the Developer Console, which overwrites the existing contents.

  4. Save the new Apex class.

  5. Close the Developer Console.

Create an Apex Data Relationship from a new DocGen Package

  1. Navigate to the App Launcher by selecting the app launcher in the upper left corner, select Nintex DocGen.
  2. Select the DocGen Packages tab.
  1. Click New.
  2. Type in the DocGen Package details and select your Starting Object.
  3. Click Save.
  4. Nintex DocGen will automatically add in the Starting Object and any child relationships it's associated with the object in the Relationships section. The starting object can't be edited unless a different object is selected.

  5. From the Relationships window, under Add Relationships, click Apex Data.
  6. Select the Apex Class you want to use for your Apex Data Relationship.
  7. For our example, we'll use SampleDrawloopApexData1SFObject.

  8. Select the Object you want to create an Apex Data Relationship with.
  9. This field is optional. In Alias, type in a short name or keyword that will differentiate a relationship to identify the tags A prefilled word block that DocGen selects for fields in your DocGen Package. The tag is a placeholder for the value being retrieved from Salesforce and it gets replaced with the relevant information when the document is generated. from that relationship in the Field Tagger A tool that displays tags for your template based on the object you're working with and easily inserts the field tags into your templates for your DocGen Package..

  10. From the Relationships section, you can edit the Repeat By field to:
  1. Click Save.

Create an Apex Data Relationship from an existing DocGen Package

  1. Navigate to the App Launcher by selecting the app launcher in the upper left corner, select Nintex DocGen.
  2. Select the DocGen Packages tab.
  1. Select and open the DocGen Package you want to work with.
  2. From the Data tab, access the Relationships window.
  3. In the Add Relationship section of the window, select Apex Data.
  4. Select the Apex Class you want to use for your Apex Data Relationship.
  5. For our example, we'll use SampleDrawloopApexData1SFObject.

  6. Select the Object you want to create an Apex Data Relationship with.
  7. This field is optional. In Alias, type in a short name or keyword that will differentiate a relationship to identify the tags A prefilled word block that DocGen selects for fields in your DocGen Package. The tag is a placeholder for the value being retrieved from Salesforce and it gets replaced with the relevant information when the document is generated. from that relationship in the Field Tagger A tool that displays tags for your template based on the object you're working with and easily inserts the field tags into your templates for your DocGen Package..
  8. From the Relationships section, you can edit the Repeat By field to:
  1. Click Save.