4 Replies Latest reply on Aug 1, 2012 9:09 AM by philmodjunk

    Exclude Zero Balance from list view records

    ShaikhAtta1238

      Title

      Exclude Zero Balance from list view records

      Post

      Hi,

                 I have a balance sheet in list view with AccountName, Total Credit, Total Debit and Balance fields. I want to add a button when the user clicks it the records with a balance of 0 will get excluded or hide and only the balance more than 0 and less than 0 will be displayed. 

        • 1. Re: Exclude Zero Balance from list view records
          GuyStevens

          You could perform a find for all records that contain "0". Then show the omitted records only.

          In a script that would look like:

          Enter Find Mode - Don't forget to clear the pause box.
          Set Field [Balance ; 0 ]
          Set Error Capture [On]
          Perform Find
          Show Omitted Only
          Sort - If you need to do some sorting

          Should work well.

          Add SubSummary parts if you want to see totals etc.

          • 2. Re: Exclude Zero Balance from list view records
            philmodjunk

            Might be simpler to use constrain found set to limit the current found set to balances greater than zero.

            Enter Find Mode - Don't forget to clear the pause box.
            Set Field [Balance ; ">0" ]
            Set Error Capture [On]
            Constrain Found Set[]

            This method allows you to pull up a sub set of your records and then click a button to drop out the zero balance entries without bringing back records excluded by the original find.

            • 3. Re: Exclude Zero Balance from list view records
              ShaikhAtta1238

              Thanks alot, the script worked out gr8

               

              A little issue is remaining as I want to also conduct a little find in a Field which I have named "Account Types" it holds only two types of variables (Daily Accounts, Account Holder) values. Now I want it such that I use 2 kinds of scripts which will trigger once clicked. One script should first find Daily Accounts remove the 0 and sort the list with the balance from highest value to lowest. The next script should also do the same with the value of Account Holders.

              • 4. Re: Exclude Zero Balance from list view records
                philmodjunk

                IF the only difference is the account type specified, write your script such that you pass either "Daily Accounts" or "Account Holder" as a script parameter. One button on your layout can perform the script while passing the first value as the parameter and a second button performs the same script but passes the second value.

                Your script can then use Get ( ScriptParameter ) to use this data as criteria in your find.