Get the 10 most recent docs in a view

I want to @Dbcolumn only the 10 most recent docs in a view.

Another option is to create a view that will only contain the 10 most recent doc.

How I would do that?

TIA.

Subject: Get the 10 most recent docs in a view

Is this for the web or the Notes client? And how do you want this displayed to the user? Do you want just a list of docs to pick from?

If for the web, it’s pretty easy. Just add a &count=10 to the ?OpenView command.

example:

http://www-10.lotus.com/ldd/nd6forum.nsf/DateAllThreadedweb?OpenView&count=10

If for the Notes client, you can embed the view on a form or a page and then set it to only show 10 lines. This works on the Notes Client even though it is in the “Web Access” section of the properties box.

Subject: RE: Get the 10 most recent docs in a view

This is for a web apps. I want to store in a field the values of the 5th column of the 1st 10 docs.

I will then parse the string i would get from the field.

if i use @subset(dbcolumn, 10) it will be just a matter of time before i max-out my dbcolumn limit.

i believe this can only be done in JS.

thanks.

Subject: RE: Get the 10 most recent docs in a view

With Javascript, you could load the xml data of the 1st 10 docs of a view and then extract the data out of the 5th column.

For example, this will give you the first 10 docs of the DateAllThreadedweb view

http://www-10.lotus.com/ldd/nd6forum.nsf/DateAllThreadedweb?ReadViewEntries&Count=10

To get the data out of the 4th column you could create an XSL stylesheet that will execute an XPath statement like this:

viewentries/viewentry/entrydata[@column=“4”]

Your Javascript would load the xml, and the xsl file, do a transfromation to get the data and then you can write these results anywhere you like.

Subject: Get the 10 most recent docs in a view

Via the notes client this isnt really possible. You can’t create a Notes view to return only first 10 for example. If you @Subset(DBColumn ; 10) You will most likely blow the dbcolumn limit eventually, depending on number of docs in view.

You COULD do it via HTTP if you REALLy have to do this. But complicated. Use java to read a view via http, and parse it out? Horrid

Subject: RE: Get the 10 most recent docs in a view

actually im already using the dbcolumn method, im already anticipating that i will max-out the dbcolumn limit, thats why i’m asking for other idea.

i’ll appreciate if somebody can post the javascript that will retrieve docs from view…

TIA

Subject: RE: Get the 10 most recent docs in a view

You can do it using the NotesViewNavigator class i.e. it gives you an exact snapshot of the view and you could stop your navigation when you reach the 11th document. Check the desinger help for more information.

cheers !!

Ashish

Subject: Get the 10 most recent docs in a view

Could you @dbColumn a hidden view that brings in the last docs within a fixed timeframe - ie last 2hrs? - probably depend on how many docs you get in the db within an hour, etc…