Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 15 Next »

Create your first Document

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:

image-20250117-083728.png

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. The only query parameter available to the param query is the id of the current record (:recordId). Using this paramter in the where condition some additional query parameters can be queried.

For example when querying the LastModifiedDate as “accountLastModDate” the additional query parameter :accountLastModDate can be used in the data queries below.

For example: “AccountId = :recordId AND ActivityDate < :accountLastModDate”

Data Queries: A set of SOQL and the corresponding merge field mapping.

image-20250117-084734.png

By clicking “Add Query” a new SOQL query can be created. When selecting the query the query details appear:

image-20250117-100118.png

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:

In case a query field was defined with a sort order, whether to sort ascending or descending

SObject:

The SObject this query should be based on. The SObject can be selected through the autocomplete dropdown. To close the dialog, press enter. Query fields can only be selected once an SObject has been selected. Once one or more query fields have been defined, the SObject cannot be changed anymore.

image-20250117-101027.png

Where Condition:

The where condition of the corresponding SOQL query. The id of the record from where the document creation process was started is available as query parameter :recordId.

For example:

“Id = :recordId" queries the current record.

“AccountId = :recordId" queries all the child records of the current Account with recordId = :recordId

Additional default query parameters:

:currentUserId: Id of the currently logged in User

:now: Current Date and Time

:today: Todays date

Group Condition:

Parent Query:

Parent Key:

Child Key:

Merge Fields:

image-20250123-091112.png

Manual Query Entry

Create the IdealDoc Template

Create an Action Button

  • No labels