5 Replies Latest reply on Dec 11, 2016 9:52 AM by argus2

    Create a Heading based on a Search Result

    argus2

      This seems simple enough but I just can't seem to make it work.

      I have a number of scripts (buttons) that perform various "finds" in my database.

      i.e.:

      "Find All Jobs Not Started"

      "Find All Jobs in Progress"

      "Find All jobs Completed"

       

      All I want to do is have text that shows up on the result window that reflects the search just performed. A heading of some kind...whether it is an actual "Header" or just simply a field that could act as a heading. This way, you know at a glance which search results you're looking at.

      At this point, I'm not sure if it's in the Script steps or a field calculation... or neither.

      Has anybody done this?

        • 1. Re: Create a Heading based on a Search Result
          beverly

          1. set a global field with the text (as part of the script)

          or

          2. set a $$variable with the text (as part of the script)

           

          then display as field or merge field (1) or merge variable (2) on the report layout.

           

          beverly

          1 of 1 people found this helpful
          • 2. Re: Create a Heading based on a Search Result
            electon

            Adding to Beverly's suggestions, if you use the global variable you can use a button bar with named buttons and its active segment set to the calculation $$yourVariableName  Setting the global to the name of the button will make it active and depending on the formatting will appear differently.

            Because you will be changing window modes, refreshing of the button bar shoukd happen automatically.

            • 3. Re: Create a Heading based on a Search Result
              argus2

              Beverly,

              I tried your (#1) solution but I think my novice skills are getting the best of me.

              Here is my Script:

              Screen Shot 2016-12-11 at 11.54.35 AM.png

              and here is my Layout showing the Merge field:

              Screen Shot 2016-12-11 at 12.04.00 PM.png

              I'm missing a key ingredient in your instructions as this gives me no results in Browse mode

              • 4. Re: Create a Heading based on a Search Result
                erolst

                Insert Text does not work if the targeted field is not on the layout (the merge field does not count).

                 

                It's much easier if you *only* use

                 

                Set Field [ JobTracking::FindResult ; "Not started" ]

                 

                which works regardless of the target's field layout presence.

                 

                If you use a globally field, you don't need to go to the first record.

                 

                btw, using a Merge Variable really isn't that different (or difficult); on your layout, change the text object to, say ...

                 

                <<$$Find_Result>>

                 

                and in your script use

                 

                Set Variable [ $$Find_Result ; "Not started" ]

                1 of 1 people found this helpful
                • 5. Re: Create a Heading based on a Search Result
                  argus2

                  Thanks erolst!

                  That was the tweaking my skills needed. Works perfect!

                   

                  ...and much appreciated thanks to beverly and electon who set me on the right solution!

                  1 of 1 people found this helpful