aguest Posted April 20, 2015 Posted April 20, 2015 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.
eos Posted April 20, 2015 Posted April 20, 2015 (edited) 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, 2015 by eos 1
aguest Posted April 20, 2015 Author Posted April 20, 2015 Thank you. That makes perfect sense to me now.
Jeff M Posted May 20, 2015 Posted May 20, 2015 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.
eos Posted May 20, 2015 Posted May 20, 2015 Set your portal […] Now, only 'Active' staff records will show in the portal. I don't see the word “portal” in the OP.
Jeff M Posted May 20, 2015 Posted May 20, 2015 You are correct, I read it wrong. I assumed that's what the OP meant as he was looking for only certain records.
Kevin Mullins Posted May 22, 2015 Posted May 22, 2015 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.
Recommended Posts
This topic is 3485 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now