Hi there,
I am working on some sort of contact management and would like to connect two tables:
- team members (TEAM / used by team to log in the database)
- contact names (CONTACTS / contact information / more or less like an addressbook)
Users have to log in at startup of the database.
A little script sets some variables like $$UserInitials, $$UserName and $$UserID.
Afterwards, the user is forwarded to a list view of all contacts.
What I would like to achieve is a connection between team members and contact names, so that each team member can "favorite" some contact addresses and have these sorted at the top of the list view and have them marked specially.
Usually, I would use a relation like TEAM <--> TEAM_CONTACTS <--> CONTACTS, but I am stuck how I could include this in sorting of a list.
May be this is a totally wrong approach?
Any help or hints are highly appreciated.
kip
Set it up as you noted with a "team contacts" join table.
Add a field to "team contacts" called "favorite", make it a number field with a default value of zero.
Add a checkbox with a value of 1 to the portal showing "team contacts".
Add the information from "contacts" to the portal for "team contacts" so it displays contact information. (or vice versa if you are showing the portal from the "contacts" context).
Change the sort order of the portal or relationship to be:
1) DESCENDING by "favorite"
2) ASC by name or any other field you want to sort by.
TL;DR - Add a favorite checkbox to your intermediary table and then sort by that checkbox before any other fields.