AnsweredAssumed Answered

Need Help with List View Filter

Question asked by user28328 on Oct 11, 2016
Latest reply on Oct 14, 2016 by user28328



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:

  1. Get the _pkOfficersID from AMAStaff WHERE UserName == Get(AccountName) AS $StaffID
  2. 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!