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
Welcome to the nuBuilder forums!
Please register and login to view forums and other content only available to registered users.
Please register and login to view forums and other content only available to registered users.
Browse screen filter
-
- Posts: 38
- Joined: Tue Jun 05, 2012 2:40 pm
- Location: Bologna, Italy
- Contact:
-
- Posts: 503
- Joined: Thu May 24, 2012 2:08 am
- Location: Milan, Italy
- Contact:
Re: Browse screen filter
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
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
-
- Posts: 38
- Joined: Tue Jun 05, 2012 2:40 pm
- Location: Bologna, Italy
- Contact:
-
- Posts: 38
- Joined: Tue Jun 05, 2012 2:40 pm
- Location: Bologna, Italy
- Contact:
Re: Browse screen filter
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
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
-
- Posts: 503
- Joined: Thu May 24, 2012 2:08 am
- Location: Milan, Italy
- Contact:
Re: Browse screen filter
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
For your application storing "old", "closed", "14fe50f78f1cd2" or what you want may be better.
Max
-
- Posts: 2
- Joined: Fri Feb 27, 2015 12:50 pm