The tc:data tag is used to do both of the following actions:
•Retrieve data from TeamConnect system fields.
•Point the Document Generator to different object records from which to retrieve data by nesting tc:data tags, thereby "navigating" to the system fields you need.
The tc:data tag can retrieve data from the following areas:
•Main object record |
Use the tc:data tag independently to retrieve single instances of data from TeamConnect system fields of the main object record. |
•Sub-objects |
Nest the tc:data tag within one of the following tags: •tc:loop tag, to automatically retrieve data from sub-objects. •tc:filter tag, to have the user select the sub-object from which to retrieve the data. These tags retrieve data from TeamConnect system fields of sub-objects, such as project assignees and categories. For more information, see: |
•Related objects |
Nest the tc:data tag within one of the following tags: •tc:search tag, to automatically retrieve data from related objects. •tc:filter tag, to have the user select the related object record from which to retrieve the data. These tags retrieve data from TeamConnect system fields of related objects (such as involved, appointment, child custom objects, embedded custom objects and child accounts). For more information, see tc:search and tc:filter. |
•Objects not related to the main object |
Nest the tc:data tag within the tc:filter tag to retrieve data from objects that are not related to the main object. For more information, see Filters for Non-Related Objects. |
•System object related to current object through a system field |
Nest the tc:data tag within another tc:data tag when a system field relates the current object to a system object, in order to retrieve data from the related system object, such as contact. For an example, see Nesting to Navigate. |
•Custom object record selected in a custom field |
Nest the tc:data tag within the tc:detail tag to retrieve data from system fields of a record selected in a custom field of type Custom Object. For an example, see Nesting to Navigate. |
When using tc:data, you must know the following concepts:
•The tc:data tag will retrieve data from the specified system field of the current object. When the tc:data tag is not nested, it points to data from the main record for which the document is being generated.
•The tc:data tag requires one tag attribute, select. It can also accept several other tag attributes, which are used to format the data item that the tag retrieves.
•When using tc:data to retrieve data, the object attribute you are retrieving with tc:data cannot be of the data type Object. An object is actually a collection of attributes that identify data, so it cannot itself be inserted into a generated document. If you attempt to do this, the generated document will contain a large amount of nonsensical code. If you need specific information from that object, you should nest tc:data tags in order to navigate to the specific data you need.
Tip: Object Model: Read This First and the additional reference tables it points to indicate the data type of each object attribute in the Data Type column of all tables. You can see which attributes have the data type Object and avoid retrieving them in a template.
•If you need to retrieve data from a custom field, use tc:detail. For more information, see tc:detail.
Whether using the tc:data tag on its own to retrieve data from the currently selected record, or if nesting the tc:data tag to retrieve data from sub-objects or related objects, the select attribute must always be used with the tc:data tag.
Required tc:data Tag Attribute
Tag attribute |
Attribute value |
Description |
select |
"ObjectAttribute" |
Specify the system field from which the Document Generator will retrieve data by typing the name of the object attribute from the Object Model, making sure to capitalize the first letter of the name. The object attributes that correspond to all system fields are found in the Object Model: Read This First and in the additional reference tables it points to. |
Example: |
<tc:data select="NumberString" /> |
The select attribute takes a system field's name as its value. In the example above, NumberString is the object attribute that corresponds to the system field, Number. Therefore, the data retrieved by the Document Generator will be the number of the record selected by the user.
The following attributes are optional attributes that can be used within the tc:data and tc:detail tag. Each optional attribute is applicable to a specific field type (such as number, date, text). These tags control the format of the data that is generated in the document.
Caution: If you try to assign an attribute to a field that is not of the appropriate type, TeamConnect is not able to generate the document and displays an error.
Optional Tag Attributes for tc:data and tc:detail
Tag attribute |
Applicable field types |
Possible attribute values |
Default |
Description |
Example |
numberFormat |
Number |
Examples: #,###.00 #,##0.00 ####.## ####.### #### |
If the format of the digit was specified with #, the number will drop all trailing and unnecessary zeros. If the format of the digit was specified with a 0, the digit will be displayed as it was typed. |
Specifies the format of number fields, including the placement of the comma and decimal point. Using a 0 instead of # tells the Document Generator to display the digit, even if it is a 0. When generating financial information, you should use a format such as #,##0.00. |
<tc:data select="Unit Price" numberFormat="#,##0.00" /> |
percentage |
Number |
###% ##0.0#% |
1/100 |
Specifies that the number should be displayed as a percentage, and whether decimals should be included. Using a 0 instead of # tells the Document Generator to display the digit, even if it is a 0. |
<tc:data select="CompletedPercent" percentage="###%" /> |
dateFormat |
Date |
MM/dd/yyyy |
Specifies the display format of date and time values. |
<tc:data select="DueOn" dateFormat="dd/MM/yyyy" /> |
|
showTime |
Date |
yes no |
no |
Shows the time next to the date. Only necessary if the value for dateFormat does not display the time. Note: This tag should only be used if dateFormat is not specified. |
<tc:data select="DueOn" showTime="yes" /> |
timeZone |
Date |
yes no |
no |
Shows the time zone (in parenthesis) next to the date. The time zone is from the current user's settings. Note: This tag attribute is only necessary if the value for dateFormat does not display the time zone. |
<tc:data select="DueOn" showTime="yes" timeZone="yes" /> |
case |
Text |
upper lower |
Unless an attribute value is specified, the text appears as you typed it. |
Specifies that the text should be displayed in all uppercase or all lowercase letters. |
<tc:data select="Location" case="upper" /> |
true/false |
Check-Box |
Any text value. |
For true, the custom field label. For false, blank. |
Specifies the display values in the document for the true and false states of a check-box. |
<tc:data select="IsAutoPost" true="Automatic posting is enabled" false="Automatic Posting is disabled" /> |
The following values are the available values for the dateFormat attribute.
Possible Values for dateFormat Tag Attribute
Value |
Example output |
yyyy.MM.dd G 'at' hh:mm:ss z |
2001.12.08 AD at 03:08:17 PDT |
MMMMM d, yyyy |
December 8, 2001 |
EEE, MMM d, yy |
Tue, Dec 8, 01 |
hh:mm:ss |
03:08:00 |
h:mm a |
3:08 PM |
hh 'o clock' a, zzzz |
03 o clock PM, Pacific Daylight Time |
K mm a, z |
3 08 PM, PDT |
yyyy.MMMMM.dd GGG hh.mm aaa |
2001.December.08 AD 03:08 PM |
MM/dd/yyyy Note: This is the default value of this tag attribute. |
12/08/2001 |
dd/MM/yyyy |
08/12/2001 |
yyyy/dd/MM |
2001/08/12 |
The date and time formats can be combined to create the desired result. For example, you can combine MM/dd/yyyy with h:mm a (dateFormat="yyyy/dd/MM h:mm a") to display the date as 12/08/2001 3:08 PM.
In tc:data tags, you can navigate throughout the Object Model to retrieve data from other objects without opening and closing separate tags for each object. If you only want to retrieve one data item from an object, rather than multiple items, it may be easier to write one tag that points to the data you need rather than nesting to navigate.
A path to a data item, or object attribute, that exists in a different object is retrieved in a single tag by writing a path to it using the object attributes that serve as relationships between objects. These object attributes are noted in Object Model: Read This First and in the additional reference tables it points to, with arrows (-->).
Follow these guidelines when navigating to an attribute within a tc:data tag:
•Separate each object attribute in the path with a forward slash (/).
•Capitalize the first letter of all object attributes in the path.
•Close the tag to point the Document Generator back to the previous object that it was pointing to.
For example:
<tc:data select="Parent/Contact/FirstName" /> |
Retrieves the first name of the Contact selected for the parent record's contact-centric field. |
<tc:data select="Project/Name" /> |
Retrieves the name of the Project record to which a Task record is related. |
<tc:data select="MainAssignee/Type/Name" /> |
Retrieves the name of the main assignee's role for a record. |
<tc:data select="MainAssignee/User/Contact/FirstName" /> |
Retrieves the first name of the main assignee for a Project record. |