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: