Page 1 of 1

Browse screen filter

Posted: Tue Aug 19, 2014 11:41 am
by alextouch
Hi

I have a form that contains invoices (customer name, amount, date and so on).
I need to separately display invoices of the current year and invoices of past years.
To do this, I think it needs to duplicate the original invoice form and change the SQL query so that it displays right records in each of two forms.
But I have to do this for many forms that contains many objects and subforms and I would take hours to duplicate all these objects from nuBuilder... so I'm looking for a better solution.
If I put the string "2014" in the Default filter for browse screen, it may works but each year I have to change that value in all buttons.
Is there a easier way to do the job?

Thank you
Alex

Re: Browse screen filter

Posted: Thu Aug 28, 2014 12:12 am
by massiws
Alex,
I faced the same problem some time ago and I solved by adding a new boolean field ("Archived", "Previous_years", "Closed", or what you want) on main table(s): in my case, users can flag this field to put the record in "older store", but you can set the value automatically - Before Saving the record, running some PHP periodically on cron, etc. - according to your logic.

Then, adding one button on Index page with a Default Filter for browse screen set to '1' (or '0') you can get "old" (or "new") records.

Hope this helps,
Max

Re: Browse screen filter

Posted: Mon Sep 01, 2014 10:28 am
by alextouch
Max

Thank you, good idea!

Alex

Re: Browse screen filter

Posted: Mon Sep 01, 2014 2:02 pm
by alextouch
Max,
I tried to do like you suggested, but there is a problem: if I use '0' or '1' in default filter, the browse screen displays all records that contains '0' or '1' in *each* field, not only in the 'archived' field.
So for example, if the invoice's "date" field is set to "31-01-2014", the browse screen always display this record because it contains both '0' and '1' in the date.
Maybe I have to use other characters in the "archived" field... or there is something else that I don't know?

Thank you
Alex

Re: Browse screen filter

Posted: Wed Sep 03, 2014 11:19 am
by massiws
Alex, in the new field you can store the value you want: in my case, the new field is boolean (client side) but when the user set the value ON, in Custom Code -> Before Save I store a unique ID value.
For your application storing "old", "closed", "14fe50f78f1cd2" or what you want may be better.

Max

Re: Browse screen filter

Posted: Fri Feb 27, 2015 1:06 pm
by jpinkmancook
experienced this one too. Good thing I visited this forum. Thanks

Re: Browse screen filter

Posted: Mon Mar 02, 2015 1:13 am
by admin
.