I created many response doc, but in a view, I want to see a doc that created most recently. how do that? any Idea?
Subject: How display a latest doc which created most recently in a view?
Make the first column sorted by @Created. This will give you the most recent document.
Subject: RE: How display a latest doc which created most recently in a view?
thanks, but it shows all doc from most recent to oldest. I want it display only a latest document in a view.
Subject: RE: How display a latest doc which created most recently in a view?
If you only want one document or selected documents to show up in the view. You can use the@Command([OpenView] ; viewName ; key ; newinstance )
followed by
@Command([ViewShowOnlySelected])
This only works provided you have document id.
If you want a more dynamic approach, set the view properties to “on Open Go to top row” now that you have the first document selected try using the @Command([ViewShowOnlySelected]). I have not tried the last before but it should work.
Subject: RE: How display a latest doc which created most recently in a view?
Thanks. but a view has ParentID and a latest response doc. so I want to see that a view can show ParentID with a latest response doc. If I have four parentID, then each ID has a latest response doc in a view. How do that?
Subject: RE: How display a latest doc which created most recently in a view?
You can create a lotusscript agent that runs every 10 minutes or so that gets a collection of child documents based on parentID and mark the latest child documents with a flag which you can then use in your Form selection criteria to restrict response documents to most recent. Example:
Select Form=“Form Name” | (@AllDescendants & MostRecent=“1”)
Subject: RE: How display a latest doc which created most recently in a view?
Good idea. thanks
Subject: RE: How display a latest doc which created most recently in a view?
Don’t forget to reinitialize all flags to zero before setting your flag so you don’t end up with mulitple response documents per category when a new response document comes in.
Subject: RE: How display a latest doc which created most recently in a view?
I know that this was posted ages ago, but as I just had the same problem and solved it by another method I thought that I would post it in case any one else finds it useful.
I have customers as the parent and loads of visit reports underneath. I wanted to simply see the customer and when their most recent visit was and the comments.
Rather than try to show the newest child I put:
@SetDocField( $ref ; “LatestRep”; ComposeDate );
into the save button for a new visit report and a similar line for the comments.
This writes to the parent the visit compose date and overwrites it as new visits are created in the future.
I now have a view which just shows the parent customers and the fields I have updated from the children.
Just a different way of thinking about it but hopefully someone will find it useful.