5 Replies Latest reply on Jan 6, 2012 12:30 PM by VenturaDon

    Creating a blank/empty find/search layout for IWP



      Creating a blank/empty find/search layout for IWP


      I'm trying to build a script that takes a user to a find layout (with limited fields); when the user gets to the layout, I want the fields to be empty without a record showing in the fields, and without all the fields being "active/highlighted" as in normal find mode. The fields have a light gray border so the user knows they can click in the field to search.

      There is no toolbar status available to the users so there is a "Perform Find" button that will continue the script after pause mode in the Enter Find Mode [Pause] step.

      When "Perform Find" is selected, the user will be taken to a separate layout where all the fields are displayed in browse mode.

      Getting to the search layout and getting to the final layout is fine, but I'm having trouble creating an "empty" layout in find mode ...

      Thoughts anyone?

      Thanks and Happy New Year to all!

        • 1. Re: Creating a blank/empty find/search layout for IWP

          Instead of entering find mode and pausing, do this:

          Define a set of fields with global storage for your search form.

          Then have the Perform Find Button perform a script such as this: (Using just one global name field for the example.)

          Go To layout [//layout where you will display results of perfomed find]
          Enter Find Mode [] //clear the pause check box
          Set Field [YourTable::Name ; YourTable::gName //gName is global field on search layout]
          Set Error Capture [on]
          Perform Find []

          There are many variations of that basic script, including "OR" type finds instead of "AND" and set field steps that combine data from the global fields with find operators such as "==".

          • 2. Re: Creating a blank/empty find/search layout for IWP

            Thank you PhilModJunk!

            • 3. Re: Creating a blank/empty find/search layout for IWP

              PhilModJunk, don't know if this thread is now closed or if you'll see it again, but 2 questions/comments on the above thread...

              The global fields work great for my purposes but for 2 issues I'm working on:

              1) How can I "clear/restore" all the global fields when re-entering that Search layout? Tried everything I can think of to create a script to use with OnLayoutEnter and am still stumped.

              2) Date fields: I understand that global date fields can only search on one entered date across all records. I've been trying to read all the posts about global/date field finds, but I'm not sure of or don't understand the work-arounds.

              I'm trying to develop the standard FM range (1-1-2012...1-5-2012) plus the normal < > searches, etc.

              I know it's in the scripting and will be burning the midnight oil again tonite trying more scripting ideas...

              Thanks again! VenturaDon

              • 4. Re: Creating a blank/empty find/search layout for IWP

                1) Script triggers do not work with IWP in response to user interaction with their web browser. The only triggers that "work" in IWP are those that are tripped by a script being perfored. Example: If the user clicks a button to perform a script and it uses Go To Layout to change layouts, an OnLayoutEnter trigger will be tripped when the script executes. If the user selects the layout from the status area, the trigger will not be tripped.

                Set Field [YourTable::globalField ; "" ]

                will clear that field.

                2) use two Date fields, such as gDate1, gDate2 to collect the dates in the range.

                Then your script can use: Set Field [YourTable::DateField ; YourTable::gDate1 & "..." & YourTable::gDate2 ]

                To enter date range criteria.

                This is an example of what I meant when I said that your scripts can combine data from your global fields with operators to produce more sophisticated criteria.

                My scriptp usually check to see if the two date fields have data. If just gDate1 has data do a search for that one date. If both have dates, use a date range expression to search for records in the range specified by the two dates.

                • 5. Re: Creating a blank/empty find/search layout for IWP

                  Thanks again PhilModJunk - it works sweet!