To create an IdealDoc document merge Data and a word template is needed. The IdealDoc Query record defines the set of queries to get the merge data while the IdealDoc Template record defines the template meta data and contains the actual docs Word template as File attachment.
Create the IdealDoc Query
Navigate to the IdealDoc Query tab to create a new IdealDoc Query record:
Choose a meaningful name for the query. For example “Account Overview Query”.
The external id needs to be unique and can be used for external systems to reference the query.
The actual SOQL queries can be entered either manually or by using the powerful query builder. In most cases the query builder should be chosen. Only for complex queries with sub queries the manual entry flag should be selected.
Query Builder:
If the query builder is used (i.e. checkbox “Manual Entry” NOT checked), the sub-tab “Query Builder” shows two sections:
Param Query: An optional query used to define additional parameters that can be used in the data queries
Data Queries: A set of SOQL and the corresponding merge field mapping.
By clicking “Add Query” a new SOQL query can be created. When selecting the query the query details appear:
For newly created queries a default query name gets generated which should be changed to a meaningful name.
Single Record:
By selecting the checkbox “Single Record” we can indicate that this query will always return exactly one entry. The impact of selecting the “Single Record” checkbox is that all the defined merge fields will be available directly in the Word template without iterating through list entries.
Sort Descending:
SObject:
Where Condition:
Group Condition:
Parent Query:
Parent Key:
Child Key: