Displaying the latest document per category in an embedded view on Web--2nd Post

Spmebody please give some idea.

I am using an embedded view to display several documents categorized by project name and date document created. I would like to display only the document with the latest date and not the others. Is there a easy way to do that.?

TIA

Subject: Displaying the latest document per category in an embedded view on Web–2nd Post

There is no easy way. View selection criteria are applied independently to each document with no reference to any other documents that may or may not have been selected.

There are, however, ways of doing this. For example, you could write some code that will, once you create a new document, find the other existing documents for the project and set a field which indicates that those other documents are not the most recent. Each individual document will then carry with it the information necessary to tell whether or not it’s the most recent. You can use that field as part of view selection criteria to exclude them from the embedded view.

Subject: RE: Displaying the latest document per category in an embedded view on Web–2nd Post

Is there a way of doing something like

SELECT Form = “Test” & @Max(@Created)

so that the view selects only the latest document per project.

Subject: RE: Displaying the latest document per category in an embedded view on Web–2nd Post

No.

This formula would select documents where the expression Form = “Test” is true (that is, documents using the Test form) and where @Max(@Created) is true (which is to say, in this context, where the creation date of the document is non-zero) for each individual document. It doesn’t evaluate a list of created dates for all potential documents for the view and return the maximum one.

Again, what you’re trying to do CANNOT be done with view selection criteria alone. This isn’t SQL, where you can group and summarize with your selection expression.

Subject: Displaying the latest document per category in an embedded view on Web–2nd Post

Just change your view selection formula. The formula can be :

SELECT Form =“Test” & (@created = @today)

I think this should display only the recent documents can be shown.

But the term “Recent” documents can have different meaning. Another way is to compare the creation dates of the documents with the today’s date and show the documents which is very recent including time stamp. That could be somewhat difficult.

Phani.