3 Replies Latest reply on Sep 8, 2011 3:51 PM by philmodjunk

    Script question

    leonhart1981

      Title

      Script question

      Post

      I'm working on a simple script but kinda got stuck. 

      I want the script to perform a find to show a specific field that is unchecked. 

      For example, I have a filed name is "Paid", I will check it after I have paid the bill. 

      So I want to make a script to quick view how many bills that still remain unpaid.....

      How could I do that? Pls help~

       

        • 1. Re: Script question
          Sorbsbuster

          The field name is 'Paid', and what data is in the field - 'Yes' or 'No'?  If that is the case the script is:

          Go to layout (the one with 'Paid' on it)

          Enter Find Mode

          Set Field (Paid, "No" )

          Perform Find

           

          There are variations on that - for example, you could specify the Find criterion in the Perform Find script step, but I think it is slightly more transparent and flexible for you this way.  (In this method make sure 'Restore Find Requests' is unchecked in the Perform Find script step.)

          You don't actually need to be on the layout with 'Paid' on it, but you do need to be on a layout from the Table with the Paid field in it.

          You could put in steps to check for no found set, ie: all the bills are paid

          You could go to a list layout, sort them by due date, and go to the first record, or if there is only one record found you could show it on a Form View layout.

          • 2. Re: Script question
            juancardona

            make the find to omit the "paid" records.

            • 3. Re: Script question
              philmodjunk

              That is what Sorbsbuster's script does, but he may be assuming details about your file that don't match what you have.

              What value in the field marks it as "paid" and what value would mark it as "unpaid"?

              Does it use a single value of "Paid" in it's value list?

              If so, either of the following scripts produce the same results:

              Go to layout (the one with 'Paid' on it)
              Enter Find Mode
              Set Field (Paid, "Paid" )
              Omit Record
              Perform Find

              Go to layout (the one with 'Paid' on it)
              Enter Find Mode
              Set Field (Paid, "=" )
              Perform Find