I need some assistance filtering a list view, please.
I've attached a section of my relationship diagram which will show a many-to-many relationship between AMAStaff TO and Sites TO using a JoinTable SiteAMAStaffJoin.
This relationship works fine and will store a "1" in the "Select" field of the SiteAMAStaffJoin table for those Sites I want the Staff Member to have access to.
The UserName Field in the AMAStaff table is directly related to the file "AccountName"
I now need to filter a list view for the "Sites" table based on the status of the "Select" field (ie. it must be 1)
So the process (as I see it in layman's terms) would be:
- Get the _pkOfficersID from AMAStaff WHERE UserName == Get(AccountName) AS $StaffID
- Find all Sites WHERE SiteAMAStaffJoin::_fkAMAStaffID == $StaffID AND SiteAMAStaffJoin::Select == 1
I have no idea how to write the correct scrip that should run OnLayoutEnter to perform the above steps though.
Would appreciate any help. Cheers!