5 Replies Latest reply on Feb 6, 2010 2:04 PM by nubee

    Get(AccountName)...where do I find this string?

    nubee

      Title

      Get(AccountName)...where do I find this string?

      Post

      Hi, I am a novice just beginning with FileMaker Pro 10.  I am trying to restrict record access to only certain users.  I have been told that Get(AccountName) is a string that I need to have in a script in order to do this.  However, I have not been able to find the string Get(AccountName).  Where do I find this and how do I add this string into a script?  Any help would be greatly appreciated.

        • 1. Re: Get(AccountName)...where do I find this string?
          deltatango
            

          it's not a string, it's a function, and that's just it: Get(AccountName).

           

          It will tell you what the current account name is when used in a calculated value.

           

          When you set privileges for that privilege set, change the edit section to say:

           

          Edit values when:

           

          Get(AccountName) = TheTable::AccountNameField

          • 2. Re: Get(AccountName)...where do I find this string?
            nubee
              

            Deltatango,

             

            Thank you for your response and explaining what a function is.  I have read through the forum, but could not find what a function is in simple terms.  Again, I am new and just learning.  Could you possibly help me out with the privilege set?  I go to "privelege set" but do not understand where I go to change the edit section that you suggested.  When in "edit privelege set" I see "data access and design" with four sub-categories with "records, layouts, value lists and scripts."  Where do I go to change the edit section(?) to add:

             

            Edit values when:

            Get(AccountName) = TheTable::AccountNameField

             

            Thank you very much.

            • 3. Re: Get(AccountName)...where do I find this string?
              deltatango
                

              Hi nubee,

               

              A function is essentially an action performed. It is something that can be DONE to a value. Functions use constants and variables. Constants = stay the same. Variables = change in value. "17" is a value. What can you do to 17? Add to it, subtract to it, etc., - these are functions. 

               

              A function always has a format: FunctionName(). The data you put inside the parenthesis are called Parameters. A parameter is a value which defines a condition or instance of something.

               

              So a made-up function which increments a number:

               

              Increment(12)

               

              Would return a value of 13.

               

               You can enter as many parameters as the functions allows/requires using a semi-colon:

               

              Increment(12;2)

               

              Might return 14 if parameter 1 was the initial value and parameter 2 was the amount to increment by.

               

              Filemaker has many built-in functions that you can use to retrieve information about your database, aside from the fields. The Get() function can pull many useful pieces of information, such as the current FileName, AccountName, PrivilegeSet, etc.

               

              You pull them by passing them as a parameter to the Get() function:

               

              Get(AccountName) RETURNS the value that is the current logged in account username.

               

              Now, to edit the privileges:

               

              FIRST, you should have created a field called "accountName" or some such, and defined it to automatically enter the Account Name, NOT username upon creation.

               

              Next go to: 

               

              File > Manage > Accounts & Privileges...

               

              Privilege Sets

               

              Double click your privilege set to edit

               

              Records menu - > custom privileges

               

              Find the your table on the list and click it

               

              Change View to yes, Edit to limited

               

              Where it says "Records can be edited when:"

               

              Enter:

               

              Get(AccountName) = WhateverYourAccountNameFieldIsCalled 

               

              Click OK until out of all dialogs. 

               

               

               I highly recommend this link for Filemaker Tutorials:

               

              http://www.youtube.com/user/FmTutorials 

               

              • 4. Re: Get(AccountName)...where do I find this string?
                nubee
                  

                Deltatango,

                 

                Thank you for taking the time to explain things in detail.  I really do appreciate it.  I will try all that you have suggested and will make another post to let you know the outcome.

                 

                Thanks again!

                 

                :smileyhappy:

                • 5. Re: Get(AccountName)...where do I find this string?
                  nubee
                    

                  Deltatango,

                   

                  Thank you for your help.  I was able to get the function "Get(AccountName)" to be recognized in the setup you have given.  I really do appreciate it.  My question on this thread actually stems from a question on another thread where I am having trouble setting things up so that a user who logs in to FileMaker is limited/restricted to viewing certain records.  Here is the thread link:

                   

                  How Can I Restrict Viewing of All Records on Certain Accounts?

                   

                  I am still having a little trouble with this but your help has pointed me in the right direction.  If you have any suggestions they would be very welcomed.

                   

                  Thanks again!