1 Reply Latest reply on Dec 21, 2012 2:04 PM by philmodjunk

    Scripting an "OR find request??

    ChrisDeith

      Title

      Scripting an "OR find request??

      Post

           Something that should be simple but I can't seem to work out how to script it!

           Two fields - [payment_status], and [payment_type].

           [payment_status] could be such as:

           ---> Paid, Not Paid, Paid (capture), Refund, Success, Not completed etc

           [payment_type] could be

           ---> ePay, Credit, Cheque etc

           I've created a find request that searches (for instance) [payment_type]="epay" which works fine - but I then need to constrain the found set to for those invoices where [payment_status] = "Paid" OR "Paid (Capture)" OR "Success" etc.

            

           The only scripting options seem to be x AND y AND z ??

           Would someone like to enlighten me with what I'm sure is the obvious, but which I cannot seem to see?!!

           Thanks....

            

        • 1. Re: Scripting an "OR find request??
          philmodjunk

               Not only can you use "Or" logic in your scripted finds, you have two different ways to do that.

               1)

               Have your script perform a find for the first set of criteria ("epay" and "paid")

               Then have your script perform a second find with different criteria ( "epay" and "Success"), but this time use extend found set instead of perform find and the rresults will be combined with the found set produced by the first find.

               2) Use two find requests.

               Enter Find Mode [] --> clear the pause check box
               Set field [YourTable::PaymentType ; "epay"]
               Set Field [YourTable::payment_status ; "Paid" ]
               New Record/Request   ----> in find mode, this step produces a new request instead of a new record
               Set field [YourTable::PaymentType ; "epay"]
               Set Field [YourTable::payment_status ; "Success"]
               Set Error Capture[on]----> keeps error dialog from interrupting your script if no records are found
               Perform Find[]