10 Replies Latest reply on Mar 13, 2010 6:07 PM by Sketter

    Script :Perform search

    Sketter

      Title

      Script :Perform search

      Post

      Hi,  So I'm trying to create a search that is initiated inside a portal.

       

      Here is the background.  The layout has a portal, in that portal there are a lists of shops (Field:Shop Name) next to it, and within the same portal line I want to create a button that copies the "Shop Name", goes to a layout a performs a find in the field Shop Name so that I can pull up everyone within the same shop obviously. 

       

      I'm having trouble creating a script with a perform find.  Can anyone help?

       

      Thanks!

       

      Pedro

        • 1. Re: Script :Perform search
          mrvodka

          What is your main parent layout based on?

          • 2. Re: Script :Perform search
            Sketter

            Layout with the portal is "Front Page"  based on Front Page table.

            Layout with the Shop Names is "Shop" based on Shops table.

            Layout to perform search is "Face Sheet" based on "Face Sheet" table.

             

            Hope that helps.

             

            Pedro

            • 3. Re: Script :Perform search
              mrvodka

              Well you can pass the name as a script parameter when you specify the script for the button. Shops::ShopName

               

              Go to Layout [ Face Sheet ]

              Enter Find Mode [ ]

              Set Field [ Face Sheet::ShopName; Get ( ScriptParameter ) ]

              Perform Find [ ]

               

               

              That being said, I dont realyl follow your structure so I cant advise on a clearer solution.

               

               

              • 4. Re: Script :Perform search
                Sketter

                I'm getting a "Operation (e.g.+,-,*....) is expected here,   and  Get ( ScriptParameter ) ] ends up being highlighted.

                 

                There are two layouts that work together.  "Shop" layout fill info some fields on the "face sheet" using a relationship. Since face sheet has all the records of different shops I want to create a sort so managing spread sheet print outs are easer with less clicks and a Front Page layout that you can do this from. 

                 

                So the goal is if I want to print out everyone from shop "A" it would be ideal if I can highlight a Shop from the portal, click on a button "view" and I get a spread sheet view of only people in Shop A.  So the Front Page layout takes the "Shop Name" within the portal, goes to the Face sheet layout, enters find mode, goes to the Shop field, enters the Shop Name, and performs find.  (or so that is how I envision it)

                 

                Hopes that helps.

                 

                Pedro

                • 5. Re: Script :Perform search
                  mrvodka

                  First you probably are putting in the Get ( ScriptParameter ) in the repetition field in the Set Field step. It should be in the Calcuated result  section.

                   

                   

                  Also, from your further description it seems as though you probably can do this using a Go to Related Records script called from the portal.

                   

                   

                  • 6. Re: Script :Perform search
                    Sketter

                    Thanks, corrected.

                     

                    I'm now getting "no valid criteria found"

                     

                     

                    • 7. Re: Script :Perform search
                      mrvodka

                      You did pass the parameter when you specified the script correct?

                      • 8. Re: Script :Perform search
                        Sketter

                        I'm sorry, but I have no clue what you mean by that.

                         

                        Like did it try to perform the find?  It did, and came back with nothing.

                         

                        If this helps, 

                         

                        The field in Face sheet is named "Shop_Look_up"  That is where the search should be preformed. 

                         

                        The field from "Shops" table is named "Shop Name"

                         

                        And what does Get ( ScriptParameter ) do?

                        • 9. Re: Script :Perform search
                          mrvodka

                          Its gets the Script Parameter that you pass when you call the script.

                           

                          When you go to specify a script such as when you put a button on the layout, you will see an area towards the bottom that says something like optional script parameter. This is where you pass the parameter.

                           

                          Then in your script that you spcify, the script step of Get ( ScriptParameter ) will gran whatever value you passed.

                           

                          For example, lets say you have a simple script that has one script step in it of Show Custom Dialog.

                           

                          Specify in the message field Get (ScriptParameter).

                           

                          Now put 3 buttons on the layout each calling the same script. However, when you go to pick the script put "blue" for the optional script parameter for button1, "red" for the optional script parameter for button2, and "green" for the optional script parameter for button3.

                           

                          Now you should see that even though you only have 1 script, passing a different parameter to it will show you a different message.

                          • 10. Re: Script :Perform search
                            Sketter

                            I kept looking in Manage scripts.

                             

                            All better now and works exactly how I want it thanks!!