3 Replies Latest reply on Oct 13, 2009 9:55 AM by philmodjunk

    Scripting help, please, to show individual users different sets of records

    ijontichy

      Title

      Scripting help, please, to show individual users different sets of records

      Post

      FMP 10 Advanced

      FMS 10

      Beginning to moderate knowledge with just a couple of ninja skills thanks to the kind folks on this forum.

       

       

      I have a few different vendors accessing my database and I want to sequester information so that they don't see each other's work.   There is some sharing and the key field to make this possible in my case is the VENDOR field, which is set up to have 3 repetitions total.

       

      I've set up user priviledges so that each vendor can only see their records, but I did so with a klugey workaround that I feel must be simpler.


      For starters, each vendor has his own unique privilege set.

       

      When setting the record viewing options to limited for each table I put this in the calculation box that comes up

       

      Records can be viewed when:

      GetRepetition ( VENDOR ; 1) = "[User #1's name]" or

      GetRepetition ( VENDOR ; 2) = "[User #1's name]" or
      GetRepetition ( VENDOR ; 3) = "[User #1's name]"

       

       

      I hope you follow me.   And then the next user has privileges where [User #2's name] fills those three positions.

       

       

      But the thing is, if I could get 

       

      GetRepetion (Vendor; 1) = Get(UserName) or (etc etc)

       

      to work, I could have one privilege set called VENDORS.    But it's not working.

       

      I feel I must be formatting something wrong or Get(Username) isn't updating when I log in as the Vendor instead of me.   The reason I suspect that is because I also set up a script that finds and sorts their records based on equating the vendor to the Username and even when I've logged in as Vendor#1 it tries to search the vendor field by MY user name.   Not sure why.

       

      Any and all help appreciated.