Urgent : Limit the no of documents in a view

How can the no of documents can be limited in a view.e.g I want to display only last 50 documents created in a view?

Subject: Urgent : Limit the no of documents in a view

Hi Aisha,

The way i could figure out is to create a agent which shall run in background on the 1st 50 documents to set a value on a field i.e to say “1” . Then set the view selction formula to look for documents with this field value.

This agent shall set 50 documents as above and then rest of the document with that field to “0”

This way you could only see 50 documents in that view.

There could be other ways also, but really depends on your requirement.

Subject: RE: Urgent : Limit the no of documents in a view

I have this problem a lot. Most of the time instead of having to modify documents with values I simply create a folder, remove all the entreis and then grab the documents that I want and put them in the folder. The easiest way I have found is by either using db.Search (which you can use formula language) Or db.ftSearch.

'-- remove from folder

Set view = db.GetView(strFolder)

Set vdc = view.AllEntries

Call vdc.RemoveAllFromFolder(strFolder)

'-- get documents that match criteria

searchFormula$ = {Form = “Communication” & Department = “Sales” & @isAvailable(companyType) = @False & finishDate >= @Adjust(@Today;0;0;-15;0;0;0)}

Set dc = db.Search(searchFormula$, date_start,0)

'-- process new collection

If dc.Count = 0 Then

Exit Sub

Else

call dc.putAllinFolder(strFolder, True)

End If

Subject: Urgent : Limit the no of documents in a view

Thanks to all of you. I will try that agent thing first.

Subject: Urgent : Limit the no of documents in a view

Initially, set a field say test in the last 50 documents in the view with “1”. In the query save event of the document, or in a scheduled agent save the 1st document’s field in your 50 document selection to 0 (This would be your views first document) and the new documents field with 1.

Create a view selection formula as below

Select form=“formname” and test=“1”

Subject: Urgent : Limit the no of documents in a view

Instead of creating all the agent and making change in view selection criteria can’t u use the property of Show single category??

Best Regards

Vinay