2 Replies Latest reply on Nov 17, 2011 9:33 AM by philmodjunk

    Filter Records By User

    PeterDowns

      Title

      Filter Records By User

      Post

      Hi

      have a database that is keeping track of projects. Each project added is tied to a user and there is getting to be a lot of projects. And if the user logs on and they go to their project screen they only see the projects belonging to themselves. When an administrator wants to view projects by user. They go from main menu screen to a pop up small screen with a drop down box with users listed. They select the user they want and click continue to move to the project screen. I am then trying to filter the projects displayed to the user selected from the previous screen but to no avail.

      The other option would to have a drop down box on the project screen that filters the records live.

      Which way would be the best way to proceed and how would i go about it??

      Whichever option I go with it is the filtering of the records once the user has been selected that I have a problem with.!!

      This is the code I was using behind the button once I have selected from the dropdown box.

      Thanks in advance

      Cheer

      Peter

      Screen_Shot_2011-11-17_at_4.15.31_PM.png

        • 1. Re: Filter Records By User
          mfs.nishant

          Hi Peter,

                I appreciate your work peter but This Script Steps will not work Correctly and will not full fill your requirement as want, As I know GTRR Is used for viewing related records either from your portal or the record which you are seeing in browse mode, But here case is different you are choosing value from drop-down list and after choose user you go for it's related record by using GTRR which is actually not possible.

                        What Should you do just capture the User-Id of Selected user from That dropdown text box in continue button script and  go to  "Record Detail - Project_AdminFilter (Project)" in same window which you used for showing pop-up message, and then Enter find mode, and send capture Id/name What ever to the filed In This table and perform Search. after this it will show all record associated with that user.This is the one way you can achieve your requirement.

          There is another way by which you can achieve same thing, By use Relation ship Based on global variable, Use a global variable which will capture User Id and and make relation ship with Project and use that Portal in "Record Detail - Project_AdminFilter (Project)".

          Cheers!!

           

          • 2. Re: Filter Records By User
            philmodjunk

            Why do you have close window as the first step? That puts your in a completely different window where the current record, layout and value in your field where you selected a user may be different.

            This script works from any layout, including the projects layout. gSelectedUser must have global storage specified or the script will not work:

            Go To layout [projects]
            Enter Find Mode [] //clear the pause check box
            Set field [Projects::UserNameField ; YourTable::gSelectedUser ]
            Set Error Capture [on]
            Perform Find

            If you use a drop down list, the OnObjectExit trigger can perform this script automatically when the user selects a value in the drop down. If you use a radio button or pop up menu format, OnObjectModify may be used for the trigger.