5 Replies Latest reply on Dec 10, 2016 5:56 AM by philmodjunk

    Conditional Record access leaving <No Access> Markers

    annata

      The privilege set calculation:

      CreatedBy = Get (AccountName)

       

      works successfully to limit access but leaves <No Access> markers in the unavailable records. Is there a solution available through the security settings to eliminate the markers.

      Any other solution?  I would really appreciate the actual script if the solution is a script because I have no experience in scripting in FM

      thx

        • 1. Re: Conditional Record access leaving <No Access> Markers
          taylorsharpe

          You can use the Inspector under the "Data" tab down where it says "Hide object when" and make a boolean calculation that hides the field for any of the privilege groups that it doesn't have access to.  Such as:

           

          Get ( CurrentPrivilegeSetName ) = [Name of Privilege Set to hide field]

          • 2. Re: Conditional Record access leaving <No Access> Markers
            philmodjunk

            Any find performed by a script or the user will automatically omit no access records. So you only need perform a script that does a find either when the file opens or when the layout is entered.

             

            Example:

            Enter Find Mode [. ]

            set field [yourtable::neverEmptyField ; "*" ]

            Set Error Capture [on]

            perform find [  ]

             

            Will find all records that user is permitted to view.

            • 3. Re: Conditional Record access leaving <No Access> Markers
              annata

              Thank you for the response which I am sure is correct but i have not yet been able to use with any success.

               

              To clarify:

              What is meant by "neveremptyfield"   should I perform the search on a field which is never empty such as the unique index field?

               

              Here is the total package that I am trying to use to achieve this mundane task, It seems to consist of 2 tasks

               

              1)

              The privilege set has a custom setting in Records

              view  CreatedBy = Get (AccountName)

              This works and delivers the found set where the unavailable records are displayed with "No Access" in the fields.

              2)

              I  attach a script to the AdminClient layout such as you have described to remove the "NoAccess" markers.

              namely:

              Enter Find Mode [. ]

              set field [AdminClients::Index ; "*" ]

              Set Error Capture [on]

              perform find [  ]

               

              Does this seem to be correct?

               

              Thanks for your forbearance

              • 4. Re: Conditional Record access leaving <No Access> Markers
                philmodjunk

                NeverEmptyField means you can use any field in its place that is never empty of data in any record in your table.

                • 5. Re: Conditional Record access leaving <No Access> Markers
                  philmodjunk

                  If you still can't get this to work. You might try testing it in a very simple demo file. If it works in the demo, you can compare it to your solution to see if you can spot what difference is keeping it from working in your solution.

                   

                  If you can't get the demo to work, you can use the advanced editor to share that demo here so that others can take a look at it.

                   

                  Hint 1:  when testing design issues that deal with access privileges, the relogin script step can make it easy to compare behavior between different privilege sets.

                   

                  Hint 2:  if you have FileMaker Advanced, you can launch the app without opening a file, enable the debugger and then open the file if you need to study a script set to run when the file opens. This works even when opening the file with limited access credentials as long as you can enter full access credentials when the debugger asks for them.