3 Replies Latest reply on Jan 2, 2012 11:29 AM by philmodjunk

    IWP onopen



      IWP onopen


      I have a members database and I allow access for chapter officers through IWP.   I have assigned account names that equal the unique identifier for each officer.  Using the Get(AccountName) I want to direct the "onopen" script to direct them to their individual record and a specific layout.  I can get them to the correct layout by an if statement script using PrivilegeSet.  Paraphrasing, if privilegeset = AAAA it goes to layout A.  AndIF privilegeset = BBBB it goes to Layout B.

      I cannot figure out how to insert the answer to get(accountName) into a find script that searches the unique identifier field.  It is either that or make a special layout for all 15 chapters.  I also thought a statement like Get(AccountName) and AccountName=Identifier might work.

      I am struggling with the logic of scripts and need a roadmap, not driving directions.  If I don't figure this out myself, I will never learn it.


      My ultimate goal is to restrict chapter officers access so they only see members of their chapter.  Am I overthinking the problem or simply a lost ball in high weeds?

        • 1. Re: IWP onopen

          If you have a text field in your table that stores the account name in a field, then this script will find the appropriate records in that table:

          Enter find Mode [] //clear the pause check box
          Set Field [YourTable::YourAccountNameField ; get ( AccountName ) ]
          Set error capture [on] //keeps dialog from interrupting script if no records are found
          Perform Find[]

          That's the basic idea. There are many possible variations of that script you can use to get what you need.

          • 2. Re: IWP onopen

            "My ultimate goal is to restrict chapter officers access so they only see members of their chapter." - by taking them to their 'own' layout you will, presumably, achieve the goal of them only seeing their own members' records through any relationships that are visible on that layout.  But I think I would also set their access privileges to only be able to see any member's record where they are listed as their Chapter Officer.

            Also, you mention taking them to a specific layout (as well as a specific record).  Is the 'security' implemented by what's on the layout, or what's visible on the record?  Or both?  You would also need to build in security that they can't choose to simply change layout, or click to another record.

            • 3. Re: IWP onopen

              I agree completely.

              Manage | Security should be used to limit access to the records. Then a find script such as I've suggested can be used to keep greyed out "access denied" records from being seen by the user. (Though any find will automatically omit access denied records, so you wouldn't actually need to do a find based on the account name.)

              See "Editing record access privileges" in FileMaker Help and check out this particular sub section: "Entering a formula for limiting access on a record-by-record basis" for a detailed description of how to set this up.