To retrieve data from all instances of a sub-object, regardless of the type, you only need to use the select attribute with the tc:loop tag and then nest the tc:data tag within the tc:loop tag.
For example, you can use this method to list all Assignees for a project, regardless of the assignee role (type). The Document Generator will print the data you specify for all of the assignees of the project.
Usage of tc:loop - Retrieving Data from All Instances of Sub-object
Tag attribute |
Attribute value |
Description |
select |
"SubObjectList" |
For the value of the select attribute, type the name of the object attribute that links to the desired sub-object. For example, if you want the Assignees sub-object for a Project, type AssigneeList. See Object Model: Read This First and the additional reference tables it points to, for a complete list of sub-objects and to find the object attribute names that identify them. Typically, attributes that link to sub-objects have the suffix "List" (AssigneeList, PhaseList, and so on). Note: The tc:data tag must be nested within the tc:loop tag in order to retrieve any data. |
Example: |
<tc:loop select="AssigneeList"> <tc:data select="User/Contact/FirstName" /> <tc:data select="User/Contact/Name" /> <tc:data select="Type/Name" /> <tc:data select="User/Contact/DefaultPhone/PhoneString"/> </tc:loop> |
The select attribute of tc:loop takes a sub-object, such as an assignee or a category, as its value. Data values from the system fields of the sub-object specified by tc:loop are retrieved by tc:data tags nested within tc:loop.
In the example given, the data retrieved by TeamConnect is the first and last name, title, and phone number of all the users who are Assignees. The sub-object Assignee is specified by the tc:loop tag. The first and last name, title, and phone number of all the users are specified by the nested tc:data tags. Notice that this information is really stored in the user's Contact record, so the tags are actually navigating to the Contact record.