1 2 3 Previous Next 39 Replies Latest reply on Feb 12, 2010 1:54 PM by Sketter

    Help with go to record button

    Sketter

      Title

      Help with go to record button

      Post

      So I'm hoping someone can help me.
      (or maybe someone can help me if they have a better architectural way)

      I have created a contact database.
      The contact database has records of some people being responsible for other people within the same database up to a max of 10.

      I have created a 10 fields. (i'm sure there is a better way with portals but i'm lacking vision since i'm new at this)
      Each field is setup as a popup box connected to a value list specified by ID_Contact, so it shows me names.

      But i need to create a "go to record" button, and i just can't seem to figure out the script for it.

      Can some one help me out?

      Thanks.






        • 1. Re: Help with go to record button
          philmodjunk
            

          Until you can set it up with a portal. Any suggestion we make will help you make your database more and more needlessly complicated.

           

          I can think of several different ways a "go to record" button might work. Can you give an example here? (But beware, my answer will be based on a portal of related records rather than a list of 10 fields.)

          • 2. Re: Help with go to record button
            Sketter
              

            If this can be done by a portal, that would be great, i wouldn't want to make this complicated.

             

            But I would need help with setting the structure of that.

             

            The needs would be as follow.

             

            Basically there are "team leaders" and these teams leaders are responsible for other people who's records are within the same database. And would also need to create a way of a go to record.

            • 3. Re: Help with go to record button
              philmodjunk
                

              In your table, define an auto-entered serial number field so that each record in the table is identified with a unique number. Will call this field, "PersID" and your table "Personnel".

               

              Create a second table named "Team" and define two fields for it:

              LeaderID, MemberID both are number fields.

               

              In your relationships graph make this relationship:

              Personnel:: PersID = Team::LeaderID (Double click the relationship line and select "Allow creation of records..." for Team.)

               

              Select the Personnel box and click the button in the lower left corner with two plus signs. This will make a new table occurrence for Personnel. Name it "Team Members".

              Add a relationship:

              Team Members:: PersID = Team::MemberID

               

              Dismiss Manage Database by clicking OK.

              Select your Personnel table, enter layout mode and use the portal tool to draw a box for it on your layout.

              Select Team as your portal's table occurrence in the drop down.

              Select the other options you want for your portal.

              Add the field Team::MemberID to your portal. Then add whatever fields from Team Members (such as their name) that you want.

              Click OK to dismiss the dialogs

              Make Team::MemberID a drop down or pop up menu with a 2 column value list. Column 1 is Personnel:: PersID, Column 2 is Personnel::Name.

              Now you can assign personnel records to a team leader by finding that team leader's personnel record and selecting personnel from the value list in Team::MemberID.

               

              Once you have that working we can move to the next step. I don't know for sure what record your Go To Record button will go to. Another team leader?, Click a button in the portal and see that member's personnel record? or Something else?

              • 4. Re: Help with go to record button
                Sketter
                  

                Hey that worked out really great!!

                 

                The go to is for person record.  Also I realized that once added, there doesn't seem to be a way to remove.

                • 5. Re: Help with go to record button
                  philmodjunk
                    

                  To remove a person from a team, you delete their record in the Team table. You can do this by putting a button in your portal's row and using Delete portal row. You can even write a script that first asks "Do you want to remove John Smith from the Adam Jones team" before deleting a person from the team.

                   

                  "The go to is for person record"

                  Yes, but for which person?

                   

                  I'm guessing you want to be able to click a button next to a team member's name and see their personnel record, but could be wrong.

                  • 6. Re: Help with go to record button
                    Sketter
                      

                    I apologize for not being clear.

                     

                    Yes, I would like to be able to go to the record of the of the person selected within the portal.

                     

                    I also noticed, that this list can be come very big, and it seems to sort by ID, is there a way to sort by name?

                    • 7. Re: Help with go to record button
                      philmodjunk
                        

                      You can double click the portal while in layout mode to bring back the portal setup dialog. You'll find an option where you can specify how the portal sorts records.

                       

                      You can add a button to the portal that runs this script:

                       

                      Set Variable [$PersID; Value: Team::MemberID]

                      Enter Find Mode[]

                      Set Field [Personnel:: PersID; $PersID]

                      Perform Find[]

                       

                      That's the simplest approach. More sophsticated approaches are possible and Go To Related Record can be used instead of performing a find.

                       

                      Go To Related Records is a very useful tool, but which is very poorly documented. To learn more about GTRR, click the following link:

                      The Complete Go To Related Record

                      • 8. Re: Help with go to record button
                        Sketter
                           "Set Variable [$PersID; Value: Team::MemberID]

                        Enter Find Mode[]

                        Set Field [Personnel:: PersID; $PersID]

                        Perform Find[]"

                         

                        It seems to stop in find mode, do I need to specify a PersID on the layout?

                        • 9. Re: Help with go to record button
                          mrvodka
                             Make sure the Pause is off.
                          • 10. Re: Help with go to record button
                            Sketter
                              

                            It is off.

                             

                            When in "Set Field" I create a "Calculated result:" where in there I specify "$PersID" ?  If this is correct, I noticed it said "Calculation result must be Text"  Does this impact anything since PersID contains numbers to begin with?

                            • 11. Re: Help with go to record button
                              mrvodka
                                

                              Nope.

                               

                              Are you sure that you are stuck in find mode and not browse mode returning no records? 

                              • 12. Re: Help with go to record button
                                Sketter
                                   Every editable field has a magnifying glass. So I do believe I'm in find mode.
                                • 13. Re: Help with go to record button
                                  philmodjunk
                                    

                                  Check your script. Perform Find will return you to browse mode and this didn't happen.

                                   

                                  Does your script look like this?

                                   

                                  Set Variable [$PersID; Value: Team::MemberID]

                                  Enter Find Mode[pause]

                                  Set Field [Personnel:: PersID; $PersID]

                                  Perform Find[]

                                   

                                  Instead of:

                                  Set Variable [$PersID; Value: Team::MemberID]

                                  Enter Find Mode[]

                                  Set Field [Personnel:: PersID; $PersID]

                                  Perform Find[]"

                                   

                                  That's the default setting for this step. You have to clear that option to keep the script from pausing as Mr. Vodka suggested.

                                  • 14. Re: Help with go to record button
                                    Sketter
                                      

                                    Found my error.

                                     

                                    It was the last step, I was using "Perform Find/Replace"  I thought you were using a short form and was leaving out the Replace. I didn't realize there was a action as so until I looked down the line just to make sure.

                                     

                                    Thanks so much guys!!

                                     

                                     

                                    But I have 1 last request, and I can put this down to rest.

                                     

                                    I have created the the button,(the script, and the delete record in portal) however I notice it's repeating itself in the portal, on rows with no entry.(one row down) Or in records without any related record.

                                     

                                    Should this be happening?

                                    1 2 3 Previous Next