AnsweredAssumed Answered

Problems with a a "find" script

Question asked by hanstrager on Apr 7, 2013
Latest reply on Apr 19, 2013 by philmodjunk

Title

Problems with a a "find" script

Post

     I've had some help in here before to create a script that would make find based om different global search fields and check boxes.

     I basically have 2 different search fields - "date"

     a drop down menu - "Seller"

     and 2 different check box fields - "Category" and "Payer"

     Before "Payer" was only a drop down menu, but when i change this around to a check box field like the "category" i kind of dosen't really work anymore.

     Basically i want every record found must match at least one of those values in Category and payer, but necessarily not all of them, but must match the criteria in "Seller" and "date"

     So far I got the following code that almost does what i want, but dosen't work when I uncheck any of the check boxes:

     Go to Layout [ “Accountant” (Zips) ]
     Set Variable [ $CategoryList; Value:Globals::Category ]
     Set Variable [ $PayerList; Value:Globals::Payer ]
     Set Variable [ $P; Value:1 ]
     Set Variable [ $K; Value:1 ]
     Enter Find Mode [  ]
     Set Field [ Zips::DATE; Globals::Date1 & "..." & Globals::Date2 ]
     Set Field [ Zips::Seller; Globals::Seller ]
     Set Field [ Zips::Category; GetValue($CategoryList ; 1) ]
     Set Field [ Zips::PAYER; GetValue($PayerList ; 1) ]
     Set Error Capture [ On ]
     Perform Find [  ]
     Loop
     Set Variable [ $K; Value:$K + 1 ]
     Set Variable [ $P; Value:$P + 1 ]
     Exit Loop If [ $K > ValueCount($CategoryList) ]
     Exit Loop If [ $P > ValueCount($PayerList) ]
     Enter Find Mode [  ]
     Set Field [ Zips::DATE; Globals::Date1 & "..." & Globals::Date2 ]
     Set Field [ Zips::Seller; Globals::Seller ]
     Set Field [ Zips::Category; GetValue($CategoryList ; $K) ]
     Set Field [ Zips::PAYER; GetValue($PayerList ; $P) ]
     Extend Found Set [  ]
     End Loop
      

      

Outcomes