1 Reply Latest reply on Mar 25, 2015 4:25 PM by philmodjunk

    One script Multiple tables?

    gremlin9297

      Title

      One script Multiple tables?

      Post

      I would like to create a script that can be used on multiple tables. This is my current script:

      Go to layout ["Count_Report" (Local_104)

      Move/Resize Window [Current Window; Height: 660 ; Width: 900]

      Set Error Capture [On]

      Perform Find [Restore]

      If [Get (FoundCount) = 0]

            Beep

            Show Custom Dialog ['No Records Found';"Please Import records to continue."]

            Go to Layout [Original Layout]

      End If

      Insert Text [Select; Local_104::gHeader; "Current Participant Count Allocation by Age Group and Default Only"]

      Sort Records [Restore; No Dialog]

       

      The goal is to use the same or similar script but instead of using "Local_104" I want it to relate to whatever table that the script is being used on. Is this possible?

        • 1. Re: One script Multiple tables?
          philmodjunk

          That isn't possible with the script as it is currently written.

          Your Go to Layout step specifies a layout based on the Local_104 table occurrence. Thus the perform find step only finds records in that one table.

          It might be possible to change the script so that it can be used to find records in multiple tables and then again, it might not be. I'd have to see the find criteria hidden inside that Perform Find Step before I can tell if it is possible.

          Go to layout as two "calculation" options that could enable you to specify different layouts.

          Instead of stored find criteria, you can set your script up to enter find mode and then use Set Field By Name to specify your find criteria.

          But many things that you might specify for a find aren't easily applied to multiple tables as different tables are intended to store data for very different entities--that's why you would define different tables in the first place.