This is a public Forum  publicRSS

Forum post

    Shaikh Atta1238
    Exclude Zero Balance from list view records
    Forum post posted June 16, 2012 by Shaikh Atta1238
    49 Views, 4 Comments
    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. 

    Answer

     

    • DaSaint
      posted June 16, 2012 by DaSaint  Permalink

      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.

    • PhilModJunk
      posted June 18, 2012 by PhilModJunk  Permalink

      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.

    • Shaikh Atta1238
      posted July 31, 2012 by Shaikh Atta1238  Permalink

      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.

    • PhilModJunk
      posted August 1, 2012 by PhilModJunk  Permalink

      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.