14 Replies Latest reply on Apr 23, 2012 7:43 PM by MikeProcopio

    Script Question

    MikeProcopio

      Title

      Script Question

      Post

      Did I reach my quota today? OK so I have a scouting database where put scouting reports of different events for each player. I want to make a button on one of the layouts where I click on a player's name and a new window pops up for the layout of the scouting report where the player's ID number gets populated on the scouting report and I can just start the report rather than going to the report layout and then having to scroll though the player ID's to find him. I put the relationship graph if needed. Thanks

      Screen_Shot_2012-04-13_at_11.03.21_AM.png

        • 1. Re: Script Question
          philmodjunk

          I am guessing that you want to start a new record in Event_Participation to link it to the player's record in the Player Base table?

          How will you select the correct Event to which to link it?

          • 2. Re: Script Question
            MikeProcopio

            Yes I sort of got it right last night I set the button up and it opened a new record, but what I want it to do is to place the player's ID intot he player ID field so all I have to do is type the report. See on the screenshot I placed 

            • 3. Re: Script Question
              philmodjunk

              yes, but you still have to specify an event. How will you do that?

              Here's the basic script for getting playerID where you need it:

              Set variable [$ID ; Player base::PlayerID]
              Go to Layout
              New record/request
              Set field [Event Participation::PlayerID ; $ID]

              • 4. Re: Script Question
                MikeProcopio

                DId I do this wrong??

                • 5. Re: Script Question
                  philmodjunk

                  The set field step is not set up right.

                  I can tell by the extra pair of [] that shouldn't be there.

                  When Setting up Set Field, there are two Specify buttons that must be clicked. To get Set Field [Table::Field ; Expression], add set field to your script and click the first button (specify target field). Select Table::Field from the list of fields. Do not click the specify button next to the repetition box. Click OK to close this dialog box. Now click the lower specify button (calculated result) and create the expression to the right of the semicolon (;). Do not try to type in the semicolon.

                  • 6. Re: Script Question
                    MikeProcopio

                    Worked like a charm, but now how can I have the script open a new window this way I can out the report in and then close it and go back to the rosters. Here is a picture of my roster page

                    • 7. Re: Script Question
                      philmodjunk

                      Set variable [$ID ; Player base::PlayerID]
                      New Window
                      Go to Layout
                      New record/request
                      Set field [Event Participation::PlayerID ; $ID]

                      • 8. Re: Script Question
                        MikeProcopio

                        Phil I had a question. In my player reports that I do for a general scouting report for the player is there a way that I can have running scouting reports and have it post the latest one in a players profile?  Ok so say I see Kobe Bryant Play 3 months ago and I write up a report and then I write a report today is there a way to have it where today's report replaces the one from three months ago until I write up another one. I know that you set up the event participation where I can write all the reports up and I can make a portal and access them, but I was wondering if there was a way so if I wrote a player report for someone 3 years ago and see him recently I can write the report and it automatically replaces the old one, but I can still make a portal somewhere and list all of the reports I ever wrote for them.

                         

                        I've been writing the general report and then writing scouting reports and keeping the original general report on the profile, and wanted to see if I can improve upon that

                        • 9. Re: Script Question
                          philmodjunk

                          You can set up a relationship sorted by date in descending order. This puts the related report record with the most recent date as the first related record. Then you can use either a one row portal to that table or just put the fields from that related table on your layout and they will automatically display data for the most recent report for that player.

                          • 10. Re: Script Question
                            MikeProcopio

                            Is there any easy way to transfer my information from my previous report(s) on the player to the new report system? Can I just use the player participation table for this or do I nee a new one??

                            • 11. Re: Script Question
                              philmodjunk

                              I'd have to review the design of your database. This could be as simple as putting a one row portal to it on the layout and specifying a sort order for the portal--that uses your existing relationships without changing them. It's quite possible that you could just find the relationship and sort it, but you'd need to test to see if it produced any adverse affects. The advantage to sorting the relationship is that you don't need the portal then, just put the fields on your layout. The advantage to sorting the portal is that you can leave your existing relaitonships unmodified and if you add the scroll bar, you can scroll back to see previous reports.

                              • 12. Re: Script Question
                                MikeProcopio

                                I tried putting the original report field on the scouting report layout, but every time I tried to put a player ID in the original report came on. Rookie mistake I suppose

                                • 13. Re: Script Question
                                  philmodjunk

                                  That would seem to indicate that the relationship is not sorted.

                                  • 14. Re: Script Question
                                    MikeProcopio

                                    Phil,

                                    I got it to work. Let me know when you have time to put that tool in my database. I still have no idea how to use it either so let me know ehn you have the time to put it in my current database and when you have some time to have dialogue about using it.