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
- Log into your Salesforce and open the Developer Console.
- From the Developer Console, create a new Apex class named SampleDrawloopApexData1SFObject.
-
Paste the contents of the sample file (SampleDrawloopApexData - 1 Sf Object.java) into the Developer Console, which overwrites the existing contents.
-
Save the new Apex class.
- Close the Developer Console.
Create an Apex Data Relationship from a new DocGen Package
- Navigate to the App Launcher by selecting the in the upper left corner, select Nintex DocGen.
- Select the DocGen Packages tab.
- Click New.
- Type in the DocGen Package details and select your Starting Object.
- Click Save.
- From the Relationships window, under Add Relationships, click Apex Data.
- Select the Apex Class you want to use for your Apex Data Relationship.
- Select the Object you want to create an Apex Data Relationship with.
-
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..
- From the Relationships section, you can edit the Repeat By field to:
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.
For our example, we'll use SampleDrawloopApexData1SFObject.
Repeat By Options
Section Copies a specific section in your document that has unique data. Table Copies tables. Each table has unique data. Row Copies rows that have unique data in each row. Group Duplicates tables that are grouped by field type. Hierarchy Creates slides with a hierarchy of relationships based on field type. The Default value is row.
- Click Save.
Create an Apex Data Relationship from an existing DocGen Package
- Navigate to the App Launcher by selecting the in the upper left corner, select Nintex DocGen.
- Select the DocGen Packages tab.
- Select and open the DocGen Package you want to work with.
- From the Data tab, access the Relationships window.
- In the Add Relationship section of the window, select Apex Data.
- Select the Apex Class you want to use for your Apex Data Relationship.
- Select the Object you want to create an Apex Data Relationship with.
- 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..
- From the Relationships section, you can edit the Repeat By field to:
For our example, we'll use SampleDrawloopApexData1SFObject.
Repeat By Options
Section Copies a specific section in your document that has unique data. Table Copies tables. Each table has unique data. Row Copies rows that have unique data in each row. Group Duplicates tables that are grouped by field type. Hierarchy Creates slides with a hierarchy of relationships based on field type. The Default value is row.
- Click Save.