I have a form for handling IT Requests.I want to design such a view in which only the last 50 requests should be displayed whenever I open the view.
Is there any way to do this?
I have a form for handling IT Requests.I want to design such a view in which only the last 50 requests should be displayed whenever I open the view.
Is there any way to do this?
Subject: Last 50 documents in a view
I don’t think you can do this directly using a ‘SELECT’ statement. I know you can select by date, e.g. documents created from todays date back say one month, which might be an approach to consider (depending if it has to be exactly fifty, or whether a months worth of recent documents is enough).
Like your other question, I think it’s a case of selecting them all, then somehow only displaying the ones you want…
If it doesn’t work in a view, it might be an idea to consider using a folder for this purpose…
Here’s some code that may help:
'Selects all the documents in the database, and provides a count
'Should be able to adapt fairly easily to just count the documents in a view
Dim session As New NotesSession
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Dim n As Integer
Set db = session.CurrentDatabase
Set collection = db.AllDocuments
n = collection.Count
Then, do something like, can only really do in psedo code:
If (the document I am interested in) Is In the DocumentCollection, then do nothing else
…
Call doc.RemoveFromFolder( “Jambalaya” )…
The documents would need to be ordered so that, say the first 50, are the ones you are interested in…
Subject: Last 50 documents in a view
There are at least three ways to do this. The first is to have an agent scan all the documents periodically and mark the last fifty. That is a very bad idea, as you are constantly modifying documents, and it still won’t always be up to date. The second is to have an agent scan all new and modified documents and populate a folder which will then be viewed. This can also remove the oldest documents from that view. This is better, but still not always up to date. The third, and preferred, method is to create a form or page with an embedded view and set that embedded view to show the first fifty items, and then just sort the view by time. That will essentially always be up to date and will not require separate processing.
Subject: RE: Last 50 documents in a view
Let me try both the ways.
Thanks.