Jump to content

Only show actyive records in Layout


aguest
 Share

This topic is 2752 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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.

Relationships.png

Link to comment
Share on other sites

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 by eos
  • Like 1
Link to comment
Share on other sites

  • 5 weeks later...

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This topic is 2752 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.