Q
Problem solve Get help with specific problems with your technologies, process and projects.

How can I create a new view that only displays documents created in the last week?

I have a form with a date field which is then put into a view. How can I create a new view that only displays documents created in the last seven days?
The best way to accomplish this without impacting view performance by using @Today is to add a field to new documents.

Modify the view selection formula to include DisplayIn7DayView="Yes".

When a new document is created, set a flag field to "yes." Have a hidden field "DisplayIn7DayView" with a default value of @If(@IsNewDoc; "Yes"; DisplayIn7DayView). This defaults the value to "Yes" for new documents but doesn't change it.

Create a nightly background process that walks the documents in the seven-day view, starting with the oldest. If the document was created more than seven days ago, set the field DisplayIn7DayView to "No." This will remove old documents. If the documents are less than seven days old, you can stop processing the view.


Member feedback:
Another alternative is to include in the view selection formula:

@Created >= @Adjust
(@Today;0;0;-7;0;0;0)
Then you don't need to modify the form or run a nightly agent.


Brian's response:
True, you don't need to modify the form or run a nightly agent, but instead just run @Today, a variation of @Now, the value of which changes every second. This means that the view would always require refreshing and rebuilding the index, which would put a load on the server. My solution only requires re-indexing when a new document is created or the night agent removes documents from the view.

Dig Deeper on Lotus Notes Domino Application Development

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close