Welcome to the nuBuilder forums!

Please register and login to view forums and other content only available to registered users.

Browse screen filter

Locked
alextouch
Posts: 38
Joined: Tue Jun 05, 2012 2:40 pm
Location: Bologna, Italy
Contact:

Browse screen filter

Unread post 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
massiws
Posts: 503
Joined: Thu May 24, 2012 2:08 am
Location: Milan, Italy
Contact:

Re: Browse screen filter

Unread post 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
alextouch
Posts: 38
Joined: Tue Jun 05, 2012 2:40 pm
Location: Bologna, Italy
Contact:

Re: Browse screen filter

Unread post by alextouch »

Max

Thank you, good idea!

Alex
alextouch
Posts: 38
Joined: Tue Jun 05, 2012 2:40 pm
Location: Bologna, Italy
Contact:

Re: Browse screen filter

Unread post 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
massiws
Posts: 503
Joined: Thu May 24, 2012 2:08 am
Location: Milan, Italy
Contact:

Re: Browse screen filter

Unread post 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
jpinkmancook
Posts: 2
Joined: Fri Feb 27, 2015 12:50 pm

Re: Browse screen filter

Unread post by jpinkmancook »

experienced this one too. Good thing I visited this forum. Thanks
admin
Site Admin
Posts: 2778
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5

Re: Browse screen filter

Unread post by admin »

.
Locked