Browse screen filter

Browse screen filter

Postby alextouch » Tue Aug 19, 2014 7:11 pm

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
alextouch
 
Posts: 27
Joined: Tue Jun 05, 2012 10:10 pm
Location: Bologna, Italy

Re: Browse screen filter

Postby massiws » Thu Aug 28, 2014 7:42 am

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
massiws
 
Posts: 503
Joined: Thu May 24, 2012 9:38 am
Location: Milan, Italy

Re: Browse screen filter

Postby alextouch » Mon Sep 01, 2014 5:58 pm

Max

Thank you, good idea!

Alex
alextouch
 
Posts: 27
Joined: Tue Jun 05, 2012 10:10 pm
Location: Bologna, Italy

Re: Browse screen filter

Postby alextouch » Mon Sep 01, 2014 9:32 pm

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
alextouch
 
Posts: 27
Joined: Tue Jun 05, 2012 10:10 pm
Location: Bologna, Italy

Re: Browse screen filter

Postby massiws » Wed Sep 03, 2014 6:49 pm

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
massiws
 
Posts: 503
Joined: Thu May 24, 2012 9:38 am
Location: Milan, Italy

Re: Browse screen filter

Postby jpinkmancook » Fri Feb 27, 2015 9:36 pm

experienced this one too. Good thing I visited this forum. Thanks
jpinkmancook
 
Posts: 2
Joined: Fri Feb 27, 2015 9:20 pm

Re: Browse screen filter

Postby admin » Mon Mar 02, 2015 9:43 am

.
admin
Site Admin
 
Posts: 3078
Joined: Mon Jun 15, 2009 9:53 am


Return to General