April 20, 201510 yr Hi, Â This might be a simple question but here goes. I've got a staff layout based ont he attached relationship. I'd like to only show those staff members with a status of Active. I've got a global variable that is set to "Active" and is linked to status field in my staff table. The values in my staff table are only Active or Leaver. However, my layout is showing all staff, leavers included. Is there a way I can only show active staff based on the attached relationship? Do I need to do something additional to this? Â TIA.
April 20, 201510 yr There is a conceptual misunderstanding in your question: A relationship doesn't determine what records are visible in a layout – which makes sense since a layout is based on a TO (table occurrence), which can be involved in multiple relationships; which of those relationships would "win" in determining the found set? In brief: any layout always lets you access all records of its base table. What a relationship does determine is which what records from a given TO you would see in a portal of that TO on a layout based on a related TO. In concrete terms: a portal into scdb_STAFF_active on a SchoolDatabase layout would return a related set of Staff records marked as active. To answer your original question: if you want to filter the records on a layout (i.e. the found set), perform a Find. Edited April 20, 201510 yr by eos
May 20, 201510 yr Set your portal to show records based on a relationship to the staff table where records = active. To do this, create a constant global value in your schoolDB of "Active"...meaning every record has this value. Now, create a relationship to the staff table where your global = status. In other words, Active = Active. Now, only 'Active' staff records will show in the portal.
May 20, 201510 yr Set your portal […] Now, only 'Active' staff records will show in the portal. I don't see the word “portal” in the OP.
May 20, 201510 yr You are correct, I read it wrong. I assumed that's what the OP meant as he was looking for only certain records.
May 22, 201510 yr The next step you could do if you wanted to; script your find for active and then attach that to a layout trigger like OnLayoutEnter. That way every time you go into the layout it will filter to you active employees, and if you wanted to see the others you could show all or do a manual find.
Create an account or sign in to comment