Cross Reference Table
A Cross Reference Table is a database Table that links rows in two or more tables.
This kind of database table is a common concept in databases in general. This page discusses various NetForum nuances with this kind of table.
Naming Convention
For information about table naming conventions, see Table and Column Naming Conventions.
Steps
Here is a Toolkit case study for adding a Cross Reference Table. This is just a checklist. Please refer to detailed pages for more information on each step.
1. Add the table with md_create_table
2. Add columns, relationships, constraints, indexes, etc. in SQL
3. Run this SQL:
execute dbo.md_privilege_populate_by_table_quick 'nameOfTable'
go
4. In NetForum iWeb, run the Object Wizard, which creates:
- Object
- Data Object(s) for all parent objects
- Form
- Search Controls
- Group Item
- Group Item Links (find, list, add, query)
- List Table
- List From Table(s) based on parent object(s)
- List Columns
5. Design the Form using the Form Designer
6. Place Form under parent form as a Child Form. If the parent form is a Profile Form, then you will also need to place the child form on a Tab as a Dynamic Profile Detail of content type of child form.
7. Add Related Object from child object, pointing to parent objects. You might need two Related Objects for a cross-reference table, one for each parent object.
8. Add Related Object Control to the Related Objects you created in the step above.
Next, choose whether you want the UI link to the parent object to be a Lookup (many parent records) or a DropDownList (few parent records).
Option 1:Lookup:
9. Add a Lookup to allow user to link child object to Parent Object.
10. Add Lookup Cross Reference to this Lookup you created above.
Option 2:DropDownList
11. Alternately, configure the Foreign Key column to the parent table to be a DropDownList. This is done in Admin -> Column.