7 Replies Latest reply on Dec 8, 2009 10:57 AM by senriz_1

    How to Add List of Accounts on Accounts Layout

    senriz_1

      Title

      How to Add List of Accounts on Accounts Layout

      Post

      I'm a novice using FMP 9 Adv.  I have an Accounts TO and Layout (from the Accounts TO) where users with the AdminPrivilegeSet can Create New Users and select their PriviledgeSet, Delete Users, and Reset Passwords.  I'd like to see a list of these Accounts (users) and their PrivilegeSets in a portal on the same layout, also if possible with the ability of clicking on a user in the portal and having that user name and privilege set automatically fill the AccountName field and Privilege Set field.  Is this possible, and if so, how?

        • 1. Re: How to Add List of Accounts on Accounts Layout
          ninja
            

          Senriz,

           

          What you describe is native to FMP.  You seem to be recreating the same thing that came free with your purchase of FMP.

           

          File>Manage>Accounts&Privileges.

           

          This has a list of Acct and PrivSet, you can double-click on an account and see PrivSet Details...

           

          Why create it again when it already exists in the same file?  All your re-creation of the system does is make your Dbase less secure with no added benefit.

          • 2. Re: How to Add List of Accounts on Accounts Layout
            senriz_1
               I'm creating this because I don't want to give any person developer [Full Access].  I have to hand off this database that I created and need to set up an Admin person the ability to create users, reset password, etc.
            • 3. Re: How to Add List of Accounts on Accounts Layout
              philmodjunk
                

              "I'd like to see a list of these Accounts (users) and their PrivilegeSets in a portal on the same layout, also if possible with the ability of clicking on a user in the portal and having that user name and privilege set automatically fill the AccountName field and Privilege Set field. "

              This sounds like you want to copy information in a selected portal row into fields on the layout. This is a simple thing to script:

               

              Set Field [LayoutsTable::Field ; PortalTable::Field]

              Do one such script step for each field in your portal.

               

              In layout mode, select all the fields in your portal row and choose Format | Button Setup...

              Select the above script and you're good to go.

              • 4. Re: How to Add List of Accounts on Accounts Layout
                senriz_1
                   This is great.  Thank you.  I just have, hopefully, one small issue.  It seems to think I'm over-writing the current record that was in the field.  When I click out, I get the error message, "AccountName is designed to contain unique values only.  Allow this duplicate value?"  With three buttons:  "Revert Record | Yes | No".  How can I get it to remove the current record?  I've tried a few things but nothing is working.
                • 5. Re: How to Add List of Accounts on Accounts Layout
                  senriz_1
                    

                  I have one other question that hopefully can be resolves with this Account Management Layout. I have created scripts to add a new account, reset passwords, etc. I have not been successful at creating a script that will change the Privilege Set. Is there a way to do that without having to delete the user account and recreate it?<!--  / message  -->

                  • 6. Re: How to Add List of Accounts on Accounts Layout
                    philmodjunk
                      

                    "It seems to think I'm over-writing the current record..."

                     

                    That's exactly what's happening.

                     

                    "How can I get it to remove the current record?"

                    Instead of removing that record, it should find that record so that the user can edit it.

                     

                    In your script, modify it to do this:

                     

                    Set Variable [$Account; Value: YourPortalTable::YourAccountNameField]

                    Enter Find Mode[]

                    Set Field [YourLayoutTable::YOurAccountNameField; $Account]

                    set error capture [on]

                    Perform Find[]

                    If [ Get (FoundCount) = 0 /* no account record found */ ]

                      Show custom dialog ["Error, no account record found"]

                    End If

                     

                    Many new users get confused the first time they try to add Set Field to a script. See the following link for step by step instructions if you need help:

                    Selecting an "All" option with checkboxes

                     

                    [Edit note: fixed minor typo]

                    • 7. Re: How to Add List of Accounts on Accounts Layout
                      senriz_1
                         Thank you.  It works perfectly!!