2 Replies Latest reply on Feb 25, 2016 6:45 AM by KristinThomson

    Showing selections unique to each user

    KristinThomson

      Perhaps I'm just not using the correct search terms in the community platform, but I can't figure out what I'm missing.

      • I'm building in FM Pro 13 advanced, primarily for iOS use
      • I have a database of 160 sessions at a conference. Each conference session is a record. Each conference session has a primary key.
      • I have 5 users at the moment, though I might get up to 30
      • Each user has an accountname (they are not just anonymous guests)
      • I want each user to be able to use a checkbox on the session record to mark their favorites among these 160 conference sessions.
      • I currently have a button on a list layout called "Picks" that is set to find/sort/show the sessions where checkbox = yes.


      All of these work for a single user, but I'm building for a multi-user environment. How do I script it so that each users' unique favorites only show up for them when they click on the "Picks" button? I know it has something to do with global fields and primary keys, but I am failing at understanding the mechanics.

       

      Related, I'd like the users' picks to be remembered, even if they logout of the session and log back in the next day.

       

      Thanks in advance for any help!

        • 1. Re: Showing selections unique to each user
          ninja

          Clicking "Yes" works in a single user environment.

           

          In a multi-user environment, FMP doesn't need to know "Yes" as much as "Who".

          When the "Pick" button is selected, I would use that click to set a field (not on the layout) to

           

          SetField( Sessions::Picklist ; Sessions::Picklist & "CR" & Get(accountname))

          CR being Carriage Return

           

          When they want to see what they have picked...do a find in the Picklist Field for their account name.

          Your Yes/No box can now just be a calculated field based on whether or not their account name exists in the Picklist field.

           

          Note that none of this is global...though depending on how slick you want the interface to be, you could set a primary key to their account name and use that to filter a portal from a self-joined table...

          • 2. Re: Showing selections unique to each user
            KristinThomson

            Thanks Eric. Your suggestion was super-helpful, and I changed the checkbox from a simple "Yes" to being associated with each user's accountname.