10 Replies Latest reply on Nov 27, 2013 6:39 AM by philmodjunk

    Hiding Toolbar for ReadOnly and DataEntry Users

    Nibbles

      Title

      Hiding Toolbar for ReadOnly and DataEntry Users

      Post

           Trying to set up a layout for IWP and need to hide the toolbar for ReadOnly and DataEntry users...Finding a mixture of answers on this. Im using FMP12Adv. What I could get so far was this:

           If(Get(AccountPrivilageSetName) = "[Read-Only Access]" or "[Data Entry Access]"

           Go to Layout ["MyLayout"]

           Show/Hide Toolbars  [Hide]

           Right now before it lets me close the calculation window it is highlighting "Go to Layout" and I am receiving a popup that says cannot find table. Any help would be appreciated. Thank you.

        • 1. Re: Hiding Toolbar for ReadOnly and DataEntry Users
          schamblee

               Your if statement is incomplete If(Get(AccountPrivillageSetName="[Read-Only Access]" or Get(AccountPrivillageSetName="[Data Entry Access]"

          • 2. Re: Hiding Toolbar for ReadOnly and DataEntry Users
            philmodjunk

                 You also appear to have entered three script steps in to a calculation dialog and this is not how you set up a FileMaker script. Each step shown has to be added in the script editor you can open in manage | Scripts by double clicking a listed script step in the script editor. The Specify Calculation dialog is only used in scripting to specify specific additional details for a given script step, such as the Get(AccountPrivilageSetName) = "[Read-Only Access]" or "[Data Entry Access]" you might specify as the calculation to use with the IF script step.

                 Your script will look like this if you set it up correctly. Note the square brackets in the IF step:

                 IF [Get(AccountPrivilageSetName) = "[Read-Only Access]" or "[Data Entry Access]"]

                    Go to Layout ["MyLayout"]

                    Show/Hide Toolbars  [Hide; lock ]

                 End IF

            • 3. Re: Hiding Toolbar for ReadOnly and DataEntry Users
              Nibbles

                   In addition to this, I probably should have asked a few more questions. PhilModJunk, I am so thankful for all of your help. Your responses have solved nearly all of the issues Ive encountered while building my first FM database.

                   So I have a Layout, it has some conditional pop up menus, a comment box, as well as some other text fields. There are also 3 read only fields which I only want populated if the record is committed via the a submit button. Right now, In FMP12Adv if I try to make selections without pressing the "New Record" Its not allowing the user to make selections.

                   Basically In IWP (which Ive still yet to test on), I need:

                   The user to be able to enter their selections and text freely after log in and coming to the said layout, (taking into consideration that their toolbar is hidden) then on the click the submit button; Commit the Record, and populate the read only fields.

                    

              • 4. Re: Hiding Toolbar for ReadOnly and DataEntry Users
                philmodjunk

                     I'm not sure that I understand what you want. Can you provide a more detailed example?

                     What is particularly unclear is whether the user is modifying an existing record or creating anew one, but I would like to see more detail than just that.

                • 5. Re: Hiding Toolbar for ReadOnly and DataEntry Users
                  Nibbles

                       Basically, the layout is to allow the user to enter data regarding a repair request. They enter data via the conditional value popups regarding the location of the repair needed. They then use text fields to enter information for 2 individuals that our maintenance tech can contact on site. They can also add comments.

                       The read only fields are as follows a repair request number (auto serial), the date of the request (auto date), the user entering the request (auto calc Get...)

                       I want the layout to have a traditional web form look and feel, so I hid the toolbar from all but admin full access users. 

                       So far, I have the "form" fields & submit button, on the form with my privilage based trigger to hide the toolbar for non admin users.

                        

                       But Im thinking, in IWP, or within our "web form" to allow for data entry. If the toolbar is gone, how will the user be aloud to enter a new record?

                       And how do I keep the record from commiting unless a submit button is clicked? And how do I make sure my repair request number only generates when a complete record has been commited? (So that my serial will remain consecutive without allowing partial records).

                        

                       Is that any clearer?

                        

                        

                  • 6. Re: Hiding Toolbar for ReadOnly and DataEntry Users
                    philmodjunk

                         I would set up global fields for data entry. Then your submit button on this layout runs a script that creates the new record and copies the data from the global fields into corresponding data fields in the new record. Your read only fields can auto-enter the needed data, but you might use unstored calculations or layout symbols (see insert symbol in the Insert menu) for the current date, and current user instead of the actual fields if you want to show this data before the record is created by the submit button.

                    • 7. Re: Hiding Toolbar for ReadOnly and DataEntry Users
                      Nibbles

                           Thanks again for your responses. The Button scripts sound easy, but I have never used global fields (at least not in FM, I have in Java though). Could you give me a little background on the purpose of global fields, and how it will help the situation? 

                      • 8. Re: Hiding Toolbar for ReadOnly and DataEntry Users
                        philmodjunk

                             Global fields store data not specific to any one record and unique to each client session. If user 1 longs on and put "Apple" in a global field, no other users can see "Apple" in it, but this field will show this text for user 1 no matter what record he is on.

                             Where this is useful, is that it allows your layout to collect user input without first creating a new blank record. Only if the user presses submit and the script that you link to that button does the needed actions does a new record actually get created. Thus if the user just closes their browser, no lasting change has been made to the database and no other user will see the data that user entered into the global fields.

                             Here' a knowledge base article on global fields and you may want to search the Knowledge base for other articles on global fields: http://help.filemaker.com/app/answers/detail/a_id/3604/kw/global

                        • 9. Re: Hiding Toolbar for ReadOnly and DataEntry Users
                          Nibbles

                               Ok i did find that the global variable allowed free data entry. However It made my conditional value lists stop working. Any ideas on how or why? I can email you a copy of the file if it will help.

                          • 10. Re: Hiding Toolbar for ReadOnly and DataEntry Users
                            philmodjunk

                                 You should be able to modify your relationships such that your conditional value lists still work. This may require setting up new occurrences of the tables storing the values used in your value list in order to keep your relationships unchanged. If you do, then you'll also need to modify your value list setups to list values from the new Tutorial: What are Table Occurrences?.