4 Replies Latest reply on Dec 20, 2012 8:43 AM by philmodjunk

    Script: Table View, Find, Sort, List View



      Script: Table View, Find, Sort, List View


           I want to create a script for a layout.

           These are the steps I need the script to go through because I need the find to be in Table view but the final data needs to be displayed in the List view.

           This is what I have so far as my script:

           1. Enter Browse Mode

           2. Go to Layout

           3. View As [View as Table]

           4. Enter Find Mode [Pause]

           <-------- this is an important step, the user inputs a find parameter for a field that is only in the Table view

           5. Sort Records by Field

           6. View As [View as List]


           The result of runnning this script is find mode in list view. The field I need to put in parameters for is NOT in list view, it's in table view.

           The first steps do get the find mode in table view. When I specify the find values and hit continue, it jumps to the find mode in list view. It doesn't sort the data or even retrieve the data from my find specifications. 

           I want it to perform the find that I input in table view (this find varies however so I can't specify it in the script) and then sort this data and then display it in list view. How do I get this to happen???


        • 1. Re: Script: Table View, Find, Sort, List View
           I would suggest that firstly pausing a script in Find Mode is fraught - don't do it. I suggest that you ask your user for their input in a Custom Dialog Box, setting a field in the table for their input, check it for consistency, then use this as your find field and sort field
          • 2. Re: Script: Table View, Find, Sort, List View


                 I would suggest to not let the user going to Table View.
                 And it is simple to let him going to a layout wich has only that field.
            • 3. Re: Script: Table View, Find, Sort, List View

                   Make the script like this

                   set variable[$findvalue = usercondition on which it will perform the find]

                   go to layout[blank layout having the search fileds only]

                   enter find mode[daon't pause]

                   set field[field=$findvalue]

                   perform find

                   go to required layout

                   Sort Records by Field

                   View As [View as List]

              • 4. Re: Script: Table View, Find, Sort, List View

                     The problem with your original script, BTW, is that it enters find mode, but never performs the find. Had you included a perform find step, it would have worked, but I agree that entering find mode and pausing for the user to input criteria is not the best, most user friendly option. I also find table view to be a frequent source of tech support calls that I could do without as it gives the user too much freedom to re-arrange the view and then they call me when they get into trouble. I prefer a list view layout where I can keep the user from getting into that kind of trouble.

                     Here's a basic outline of a scripted find I use. It's nearly identical to the one recommended by Atauf:

                     Enter Find Mode [] ---> clear the pause check box
                     Set Field [Yourtable::YourField ; Globals::GlobalFieldWithCriteriaEnteredByTheUser]
                     Set Error Capture [on] ---> keeps error dialog from interrrupting your script if no records are found.
                     Perform Find[]
                     #Then sort your records etc as needed to present your found set of records the way you want your user to see them.

                     Then all you need to do is place that field with global storage on a layout somewhere so that the user enters criteria into that global field, then clicks a button to perform this script. There are many possible variations of this basic approach.