Hi there,
I would like to create a view in calendars here (a normal list view) that will show all documents for the next 7 days only. Can someone please explain to me how I can do this? In my mind I keep thinking it should be simple but for some reason I can’t figure it out!
Thanks!
Alex
Subject: View to show just the next 7 days in a calendar
From designer help:
CalendarFormat
The CalendarFormat @command changes the number of days that a calendar view displays. The Web options are:
@Command([CalendarFormat] ; “1”)
@Command([CalendarFormat] ; “2”)
@Command([CalendarFormat] ; “7”)
@Command([CalendarFormat] ; “14”)
@Command([CalendarFormat] ; “30”)
@Command([CalendarFormat] ; “365”)
This @command is equivalent to a URL command formatted as follows:
http://host/database/universalID?OpenView&Grid=n&Date=yyyy-mm-dd
HTH,
Simeon
Subject: RE: View to show just the next 7 days in a calendar
Thanks for that, although will that allow me to have a view in which I can create an agent to export just those seven days of entries rather than the entire calendar?
Subject: RE: View to show just the next 7 days in a calendar
No, I don’t think so.I see two options for your agent:
1.Read all documents, calculating day difference from today; Start export when => 0; stop when >6. Simple, but slow…
2.Create a field “DaysFromToday” and maintain it with a scheduled agent. In this case the export agent will be much faster - if this is a concern.
HTH,
Simeon
Subject: use the view selection formula
… and add these conditions to whatever your current selection is (making sure you don’t have other date-specific conditions there):… & YourDateField <= @Adjust(@Today; 0; 0; 7; 0; 0; 0) & YourDateField >= @Today
You may have to use @Date(YourDateField), depending on whether you store the time in it also.
Subject: RE: use the view selection formula
Sure, this is the easiest way, but using @Today in view selection formula is - in my view - extremely bad practice (huge performance impact & other issues, sometimes unpredictable)
Subject: RE: use the view selection formula
Calendars, by their nature, generally don’t have the number of documents in them that would cause a noticeable loss in performance.
And if you add all the lost time, it wouldn’t equal the time he’s going to spend on a scheduled agent to update docs with “days from today”.