Retrieving Data through Contact-Centric Fields
- Last updated
-
-
Save as PDF
The following sample is going to retrieve data from a contact-centric system field found in a custom object definition.
The first tc:data tag navigates to the Contact object using the contact attribute of TProject. From there, the nested tags retrieve the following types of data about the contact.
- System fields
- Custom fields
- Sub-objects
- Related objects
Also, after navigating back to the main object (Claim) by closing the tc:data tag that navigated to the contact, the template retrieves data from a related object, Involved, using a filter defined in the header.
|
<?xml version="1.0" encoding="UTF-8"?>
<tc:document version="1.0" mime-type="application/ msword" name="Contact-Centric Custom Fields" xmlns:tc="http://www.w3.org/1999/XSL/Transform"> |
Creating Filter Screen for Related Objects
|
<!-- The header section identifies the filter screen that will be displayed to the end-user. The filter screen will display the Involved parties associated to the Claim. The related object records in the filter screen will be displayed in a drop-down list. -->
<tc:header>
<tc:filter name="SelectInvolvedParties" searchCondition="Involved" label="Please select the Involved Party" displayString="Contact/ FirstName;Contact/Name;DefaultCategory/Name" displayFormat="* * - *" />
</tc:header>
<tc:content><tc:data select="Contact">
First Name:
<tc:data select="FirstName" />
Last Name:
<tc:data select="Name" />
|
Retrieving Data from Custom Fields
|
<!-- The following tags retrieve data from the custom fields within the Contact record. These custom fields are defined for the category Employee. -->
Hire Date:
<tc:detail select="CONT_EMPL/HireDate" />
Salary:
<tc:detail select="CONT_EMPL/Salary" />
Employee Type:
<tc:detail select="CONT_EMPL/ EmployeeType" />
Comments:
<tc:detail select="CONT_EMPL/Comments" />
Citizen:
<tc:detail select="CONT_EMPL/Citizen" true="Yes" false="No" />
Book:
<tc:detail select="CONT_EMPL/Book"><tc:data select="Name" /></tc:detail>
|
Retrieving All Instances of the Sub-object Address
|
<!-- The following tags retrieve all of the addresses added to the contact record. In this case, the tc:loop tag is used because we want to retrieve all of the addresses added to the contact record, not just a specific type of address (which would require the qualifier attribute) or one that the user selected (which would require tc:filter to be used instead of tc:loop). -->
Address Information
<tc:loop select="AddressList">Street: <tc:data select="Street" />
Street:
<tc:data select="Street" />
Country:
<tc:data select="CountryItem/Name" />
</tc:loop>
|
Automatically Retrieving All Instances of the Related Object History
|
<!-- The following tags retrieve all of the history records created for the contact record. In this case, the tc:search tag is used because we want to retrieve all history records that were created for the contact record, not just a specific history record (which would require the qualifier attribute or tc:conditional) or one that the user selected (which would require tc:filter to be used instead of tc:search). -->
History Information
<tc:search link="History">
Archived On:
<tc:data select="ArchivedOn" />
Default Category:
<tc:data select="DefaultCategory/Name" />
Notes:
<tc:data select="Text" />
</tc:search></tc:data>
|
Retrieving the User- Selected Related Object Involved
|
<!-- The following tags retrieve data pertaining to the involved party that the user selected while generating the letter. In this case, the tc:filter tag is used because we want to retrieve the data pertaining to the involved party that the user selected. -->
Involved Information
<tc:filter select="SelectInvolvedParties"><tc:data select="Contact">
First Name:
<tc:data select="FirstName" />
Last Name:
<tc:data select="Name" /> </tc:data>
|
Automatically Retrieving All Instances of the Sub- Object Category
|
<!-- The following tags retrieve the categories added to the involved party record. In this case, the tc:loop tag is used because we want to retrieve all of the categories added to the user selected record. -->
Role:
<tc:loop select="DetailList"><tc:data select="Category/Name" />
</tc:loop></tc:filter></tc:content></tc:document>
|