10 Replies Latest reply on Aug 2, 2013 11:01 AM by petery009

    Filter Records

    petery009

      Hi everyone

       

      There's a situation : i have 5 different users , and i don't want them to see each other's data. or say, they can ONLY see their own data !

       

      Is there a better way to do that besides "find" ?

       

      Thanks !!!

       

       

      Peter

        • 1. Re: Filter Records
          Mike_Mitchell

          Peter -

           

          The normal method for accomplishing this is to use the security model. Basically, you set a field equal to the Account Name of the creating user, then set a calculation in the security model to allow records to be viewed only when that field equals the account name ( Get ( AccountName )) value of the current user.

           

          There are some additional considerations to improve the user experience. An indicator ("<no access>") will appear in all fields when a user doesn't have access to a given record. While this functions, it's jarring to users. To alleviate this, it's suggested to implement some additional controls:

           

          1. Trap the "Find All" command (Ctrl-J/Cmd-J) using Custom Menus to execute a script that, instead, finds all records created by the current user.
          2. Trap the "Perform Find" command in Find mode to execute a script that includes a "Constrain Found Set" command, isolating the found set the user has specified to include only those records that also were created by that user.
          3. Place a script within your navigation so that, whenever a user navigates to a new layout, the records are restricted to the current user's.

           

          HTH

           

          Mike

          • 2. Re: Filter Records
            petery009

            Thanks for your reply Mike!

             

            It works!!

             

            Just wonder is there any other ways to do the filter records, like the portal filtering?

             

             

            Thanks!

             

             

            Peter

            • 3. Re: Filter Records
              Mike_Mitchell

              Well, one thing you can do is ... use portal filtering.   

               

              You can create an interface with a parent record, one with a portal linked to all the child records that match the portal conditions. Does have some limitations ( record lock is a big one), but it can actually be easier to implement. It all depends on what you want to accomplish in your interface.

               

              Another option is to use the Separation Model. Create one interface file for each user, one that filters the records automatically via a specifically-crafted set of relationships for that user. Very effective, but dangerous as a precedent if your user base expands.

               

              A lot depends on your specific situation. So you pick the method that fits best.

               

              Mike

              • 4. Re: Filter Records
                BruceRobertson

                If the security model has been set up to control access, then the only step that needs to be changed is the Show All Records command; as Mike mentions.

                 

                Any other find operation will only select records you are allowed to look at.

                 

                A slightly different way of handling the find all command is to use custom menus to point it to a script that finds "*" in for instance, the RecordID field.

                 

                Again - this will only select records you are allowed to look at.

                • 5. Re: Filter Records
                  Mike_Mitchell

                  Okay, that's just cool. Is that a new behavior? Because I don't remember that from before. (But I am getting older.)

                   

                  Mike

                  • 6. Re: Filter Records
                    BruceRobertson

                    AFAIK it has always worked that way.

                    • 7. Re: Filter Records
                      Mike_Mitchell

                      Sigh. Early onset senility.

                       

                      Thanks, Bruce.

                      • 8. Re: Filter Records
                        BruceRobertson

                        You're a very experienced developer and did not know this particular feature - seems more like a documentation issue.

                        • 9. Re: Filter Records
                          petery009

                          Wow , That's cool !!

                           

                          Thanks!

                          • 10. Re: Filter Records
                            petery009

                            Tested !! That's exactly what we looking for !

                             

                            Thanks very much !!!