3 Replies Latest reply on Aug 5, 2013 2:19 PM by BatuhanGizer

    If question

    BatuhanGizer

      Title

      If question

      Post

           Hello,

           I am trying to make a search button.  I was using a simpler search script as follows;

            Enter Find Mode[]

           Set Field[Accounting::Type; "Check"]

           Perform Find[]

           and sorting in the end.  What I would like to achieve is there is a field named "Status" and there are 3 values from a dropdown list "Paid" "Returned" and "Bounced" or the user will not enter any of the values from the list if the date of the check has not come by.  If the user selects "Paid" , I don't want to see that check in my Check portfolio.  So I thought of two different things but couldn't figure out how;

           1) Adding an "If' statement to my script and it will omit the record if "Status" field is "Paid" in search results but couldn't figure out how to implement the if statement.

           2)Searching for Accounting::Type; "Check" first and search for "Returned" "Bounced" or "" (no value) but couldn't figure out how to do the secondary search.

           Thanks!

        • 1. Re: If question
          ninja

               I think you're looking for a second found set...

               Check out the "Constrain Found Set" function in the script...and the "Omit Records" step.

               Enter Find Mode[]

               Set Field [ Accounting::Type ; "Check" ]

               Perform Find

               Enter Find Mode []

               SetField [Accounting ::Status ; "Paid" ]

               Omit Record

               Constrain Found Set []

                

               For the second one:

               <!-- / sig --><!-- / sig -->Enter Find Mode[]

               Setfield [ Type ; "Check" ]

               Perform Find

               Enter Find Mode

               Setfield [ Status ; "Bounced" ]

               New Record/Request

               Setfield [ Status; "Returned" ]

               Constrain Found Set []

                

          • 2. Re: If question
            philmodjunk

                 Ninja's first scripted example could also be set up this way:

                 Enter Find Mode[]

                 Set Field [ Accounting::Type ; "Check" ]

                 New Record/Request

                 SetField [Accounting ::Status ; "Paid" ]

                 Omit Record

                 Perform FInd []

                 It's a slightly shorter script and produces the same results.

            • 3. Re: If question
              BatuhanGizer

                   Thanks!