Home > WebEOC > Admin Guide > HTML Conventions > Related Data Tags

Related Data Tags

Related data tags can help you create relationships between tables, show data from tables, and more. Below are details regarding these tags, including some examples on how to put them to use on your WebEOC boards.

You may wish to review the allowed values and requirements so as to better understand the tags listed and how to properly implement them on your boards.

Tags

<foreignkey>

Creates a one-to-many relationship between tables; for child input views only.

For example, the Resources board has two tables, Resources and Deployments. Resources is the parent table in the parent-child relationship. When setting up a parent-child relationship within WebEOC, the input view for the child table always has a <foreignkey> tag pointing back to the parent table; this causes WebEOC to create a field in the child table that stores the ID of the parent record that each child record is related to.The Deployments input view has a <foreignkey> tag that links many deployments to a single resource. The <foreignkey> tag must have a <table> attribute that specifies the name of the table to be related.

Attribute

Allowed Values

Requirements

Description

table

%tablename

Required

Name of the parent table.

type

(select)viewlink

Implied

How the child view is accessed; select=a drop-down of records. If this attribute is omitted, the input view is assumed to be accessed from a <viewlink> tag that passes the foreign key value. 

filter

SQL

Optional

SQL WHERE clause; used to filter a foreign key Select list.

sort

SQL

Optional

SQL ORDER BY clause.

Tip: If you use "select" for type, include the <eocfield> tag to populate the drop-down.

    <foreignkey table="Resource" type="select"><eocfield type="fk" table="Resources"></foreignkey>

<foreignkeyreference>

Replaces a child's <eocfield> reference to a parent's data ID with a reference to the parent's table ID, wrapped within an expression. Since expressions in related lists are not supported in WebEOC, this cannot be used in a parent to pull the child's data ID.

Attribute

Allowed Values

Requirements

Description

table

%tablename

Required

Name of the parent table.

An example output when using this tag would be fk_table_## where ## is the table ID of the parent table.

<relatedlist>

Displays data contained in relational tables; allowed in input views or single record display views; nested <eocfield> tags must have table and type set.

Attribute

Allowed Values

Requirements

Description

table

%tablename

Required

Name of the table. Use the table and type attributes on any <eocfields> within the <relatedlist>.

sort

%tablename

 

What field to sort by.

Example

<relatedlist table="Deployments">
<eocfield name="FieldName" table="Deployments" type="rl" /> <br />
</releatedlist>
rlid Attribute in 7.0.3 and IAP

If a <relatedlist> is repeated within an <eocrepeatallrecords> tag and not contained by a second tag, use <rlid>. <rlid> attributes are given to <relatedlists> to avoid repetition when a <relatedlist> is used twice in one view.

There is no set <rlid> value for a <relatedlist>. In fact, the <rlid> value for a particular <relatedlist> does not have to be the same in all views it appears in. The <rlid> is strictly a user-defined unique identifier for a <relatedlist> in a particular view.

<eocrepeatallrecords>

	<h1>Display ICS 203 Personnel Information</h1>
	The branches are as follows:
	<relatedlist table="ICS 203 Branch Table" rlid="1">
		<relatedlist table="ICS 204 Division Table">
			Display Division info
		</relatedlist>
	</relatedlist>
	
	<h1>Display ICS 207 Org Chart</h1>
	The org chart is as follows:
	<relatedlist table="ICS 203 Branch Table" rlid="2">
		<relatedlist table="ICS 204 Division Table">
			Display Division info
		</relatedlist>
	</relatedlist>
	
</eocrepeatallrecords>

In the example above, note that the only use of <rlid> is for the repeated table, ICS 203 Branch Table. Repetition occurs when a <relatedlist> is repeated inside an <eocrepeatallrecords> tag  and the <relatedlist> is not enclosed in a parent <relatedlist>.

To illustrate this, look at the user of ICS 204 Division Table and note that it is repeated within the overall scope of the <eocrepeatallrecords> tag. However, each of the 204 related lists are contained in a 203 related list. They don't see each other, so there is no repetition. Similarly, the ICS 203 related lists are only in the <eocrepeatallrecords> tag. Therefore, the <rlid> attribute is not required to avoid repetition.

<relatedexpression>

Calculations from data contained in relational tables; can be nested in <expression>.

Attribute

Allowed Values

Requirements

Description

name

CDATA

Required

Name of the relatedexpression.

table

%tablename

Required

Name of the child table.

where

SQL

Optional

SQL WHERE clause; used when doing aggregate functions.

Example

<relatedexpression name="totalcost" table="deployments">
Sum(cost*quantity)
</relatedexpression>
You must to post a comment.
Last modified

Tags

Classifications

This page has no classifications.