Portal filtering using global variable - Looking for better solution
- Each Instructor dataset includes a field holding his AccountName. When an Instructor logs into the database I am searching for the matching Instructor dataset and store its ID as a global variable (which is specific for one session only).
- On a layout based on a Clients table occurrence the Friendship checkbox is display within a portal. This portal is filtered using $$Logged_In_InstructorID = fID_Instructor so that only the one checkbox is displayed which is related to the Instructor currently logged in.
- Each time a new Client is added a new dataset in the Friendship table is created as well and fID_Client is assigned and fID_Instructor is set from the global variable. The same holds true whenever an Instructor is viewing an existing Client dataset for the first time i.e. when no record exists in the Friendship table including his ID and fID_Client.
What I dislike about this solution: