Introducing PTWin

Introducing
PTWin32

Support Services
Support
Services

Downloads
Downloads

User Tips
User Tips

Contact Us
Contact Us

Introducing PTWin
Home

  PTWin User Tips / DATA MODEL  Data Model

Pushing the Post Button

Where did it come from?
Grasping Reference Keys & Types
Understanding links between associated records

Tip #: 4.1.78
Ver(s):PTWin32, V2, V1

Making a data model for a report you are writing is simple if the tables you want to use are related only to each other. For example, linking the permit ADMIN table to its associated records in the PERMINFO table requires only that you link the Permit Key field that is common to both tables.

However, many of the dependent secondary tables in PTWin32 work with multiple PTWin32 modules. For example, records for things like Conditions, Violations, Graphics, Fees, and Inspections can be associated with a Permit, but they can also be associated with a Code Enforcement action.

When the records in a table can be attached to more than one source we add a field called Reference Type to keep track of the source.

The Reference Key field stores the source table’s key value. Since in this example, the Reference Key can store both Permit Key and Code Enforcement Key values the names of the fields to link cannot be the same.

So for example, to link the PERMINFO table to its associated records in the FEES table you would link the Reference Type in the PERMINFO table to the Reference Type in the FEES table, then you would link the Permit Key in the PERMINFO table to the Reference Key in the FEES table.

There are many examples of this situation in PTWin32 but they all link in the same way. If you see Reference Type and Reference Key fields in the table you are adding to your report link the Reference Type fields, then link the key value from your source table to the Reference Key. This two-field link will select your associated records from the secondary table and produce the report you were looking for.

 

 

Return to Data Model menu Return to Data Model menu