1 Reply Latest reply on Jan 11, 2012 1:44 PM by philmodjunk

    multiple searches from same field

    catinthehat

      Title

      multiple searches from same field

      Post

      I have a list layout and in the header a search field to find records based on employee. users can chose from a value list in that field and click 'search' which triggers a script that sets a variable $employee >Enter find mode>set field ::employee ; $employee> perform find.

      This works but what to do if i want to show records for multiple employees. I want to show all the records in january for john, mary and bobo the clown.

       

      any suggestions?

       

        • 1. Re: multiple searches from same field
          philmodjunk

          How will the user specify multiple employees for one find? A separate field for each such selection? A table of search criteria? A, gasp, repeating field?

          All could be used. Let's say you use number fields with value lists that enter the employeeID when the user selects a name. And January is a text field with a value list of the 12 month names. Since you haven't specified what year for the specified month, I'll use the year of the current date, but you can also use an additional field for specifying the date if you wish.

          Set Variable [$Month ; value: Ceiling ( Position ( "JanFebMarAprMayJunJulAugSepOctNovDec" ; Left ( Globals::gMonthName ; 3 ) ; 1 ; 1 ) / 3 ) ]
          Set Variable [$EmpIDList ; value: List ( globals::gEmpID1 ; Globals::gEmpID2 ; Globals::gEmpID3 ) ]
          Enter Find Mode []
          Loop
              Set Variable [$K ; Value: $K + 1]
              Set Field [YourTable::DateField ; $Month & "/*/" & Year ( Get ( CurrentDate ) )] // using MMDDYYYY date format
              Set Field [ YourTable::EmployeeID ; GetValue ( $EmpIDList ; $K ) ]
              Exit Loop If [ ValueCount ( $EmpIDList ) < $K ]
              New Record/Request
          End Loop
          Set Error Capture [on]
          Perform Find []