You can define a filter for the document template so that when the user launches the Document Generator, a filter page opens. The user can then select a record, such as a claimant (an Involved), from a drop-down list. Data from this record can then be retrieved in the content of the document.
In the content section of a document template, tc:filter is used to switch focus from the current object record to the record that will be selected by the user in a filter page. Once this object is selected as the current object, you can retrieve data from it using other tags.
For example, if your document template is for a custom object named Claim, you may use tc:filter to retrieve data from involved, appointment, task, history, child objects, or any other objects that are related to Claim and which have been selected by the user in filter pages.
In the header section, you will need to specify how the filter page will appear in the end-user interface of the Document Generator. You will learn more about this in Defining Filter Pages.
Use tc:filter in the content section when you want to retrieve data from any of the following records or sub-objects which have been selected by the user in filter pages:
•A related object. The related object can be any of the following:
oChild custom objects
oEmbedded objects
oChild accounts (if the main object is an account)
oRelated system objects (for example, a project's involved, appointment, or history records), except document.
•An object that is not directly related to the main object.
For example, the main object of your template is Policy, whose child object is Claim. You may want the user to select the involved parties of the related Claims.
•A sub-object.
For example, you may want the user to select an Address, Assignee, or Email Address. You can define filter pages that enable users to select these sub-objects.
•An object that is not related to the main or current object, such as Documents.
For example, you can use tc:filter to retrieve data from a Contact that the user selects, when that Contact is not related to the main object record.
You would not use tc:filter in the content section under the following circumstances:
•When you do not want the user to select the related records or sub-objects. If this is the case, use tc:search or tc:loop to automatically identify the records and retrieve the correct data.
•When the relationship from the main object to the desired object is found in a custom field.
For example, if Party and Claim are custom objects and there is a custom field in Claim of type Custom Object that is used for selecting a Party record, then you would navigate to the Party record using tc:detail.
•When the relationship from the main object to the desired object is directly found in a system field.
For example, from a Claim record, its parent Policy record is found in the system field Parent. Therefore, tc:data is the tag used to get to the data in the Policy record.
You would use tc:filter, however, if you want the user to select an object that is related to the record selected in the system field. For example, if you wanted to use records selected by the user from the Involved records of the Policy mentioned above, this would require the use of tc:filter.
•When you want to retrieve data from a sub-object and you do not want the user to select an instance of the sub-object.
For example, if you want to navigate to the Contact record of Assignees and automatically list the names of all assignees from their Contact records (instead of having the user select an Assignee), then you would use tc:loop.
When using tc:filter, you must know the following concepts:
•The tc:filter tag does not actually retrieve data and insert it in the generated document. tc:filter is used for navigating to the correct object in TeamConnect to identify the data you need. In order to retrieve data from that object, you use other Document Generator tags, such as tc:data and tc:detail.
•You can nest other tags within tc:filter as needed in order to navigate to the desired objects.
•You must always define the filter using a tc:filter tag in the header of the document template. In the content section, you use tc:filter again to reference the filter you defined that identifies the record(s) from which you want to retrieve data. You will learn more about this in Defining Filter Pages.
•The filter that you define in the header section of the document template can allow the user to select one or multiple related object records.
•Use tc:filter when you need to retrieve data from a sub-object that is selected by the user. Then, in the header section, use the tc:filter tag to define that filter as a filter page.
•You can refer to the following for samples of document templates using tc:filter:
oAutomatically Retrieving Data from Related Objects.
oIncluding Information When Certain Conditions Are Met.
The following table describes the attributes of the tc:filter tag when you are using it in the content section of the document template.
tc:filter Tag Attribute
Required? |
Tag attribute |
Attribute value |
Description |
Yes |
select |
"FilterName" |
Type the unique name for the filter that will appear in the filter page in the end-user interface of the Document Generator. This is the name that you define for the filter in the header of your document template. Tip: If you have not yet defined the filter in the header section of the document template, you can choose a name for it now and use this name later when you define the filter. For more details, see Defining Filter Pages. Important: The tc:filter tag does not retrieve any data by itself; you must nest other tags within the tc:filter tag to retrieve data. |
No |
list |
"yes" or "no" |
By default, this attribute is set to "no". You must set list="yes" when the filter you are using is a hidden filter. For details, see Defining Filter Pages. |
Example: |
<tc:filter select="InvolvedParty"> <tc:data select="Contact"> <tc:data select="FirstName" /> <tc:data select="Name" /> </tc:data> </tc:filter> |
In the example given, the data retrieved by TeamConnect will be the first and last name of the Contact, who is an Involved Party of the Claim record. The user will choose which Involved Party's data should be retrieved when invoking the Document Generator. InvolvedParty is the filter chosen. The filter that you select here is defined in the header section of the document template.
You can find more examples using tc:filter in Document Template Samples.