I have already designed the embedded view to show response docs. I need to now make it so that it only shows the most recent response document. I would really appreciate the help.
Subject: Design an embedded view to only show most recent response
define RECENT and put that in the Selection formula
Subject: RE: Design an embedded view to only show most recent response
There’s no way to write a selection formula that chooses documents based on their date/time relative to other documents. You would have to be able to tell from looking at that document alone that it was the most recent. You might do this by having an agent or Postsave code to go find the old “most recent” response and clear a field that’s used to locate the most recent response. Postsave takes effect immediately but depends on having access to edit the other response and can produce duplicate “most recents” and replication conflicts if there are multiple replicas of the application where people are creating responses for the same document. A server agent is more reliable but there is some latency (especially if there’s replication delay involved).
Another way you might consider, is to just make the embedded view only tall enough to display the first row. If they really want to scroll down to see earlier responses, why not let them?
For that matter, I don’t really see what the problem is in just sorting them with most recent first and showing all of them.
Another possibility, if you want to display just one row, the whole idea of using a view is overkill. Why not just put a row of fields there and read values from the document in question? You can use an @DbLookup with UNID return value to get the latest response, then read fields from it and display them. The UNID can also be used to make a hotspot link via Notes URL format, if you want them to be able to open it.
Subject: Design an embedded view to only show most recent response
I can go for a folder, instead of view. So that i can programatically place the most recent response in it.
Do you like the idea?
Adi