How to show only the last entry on a view

Hello:

Does anybody knows how to show only the last entry on a view. Let me explain; I need to show in a view our clients and their last invoice, it does not matter if it is from hours ago or months a go. We need to see what was the last purchase based on purchase date field. Any ideas will be great.

Thanks

Subject: Does it have to be displayed in a view?

If not, you could write some code in a PostOpen event of a form to call NotesView.GetLastDocument and then display the values you want from the last document.

Subject: Thanks for your response

Thanks for your response. I was thinking of a view because I thought that there may be something already done. I can do a report and collect the name of each client and find the last invoice. What I was looking with the view was that they can open the invoice document and get more details on what the sale was about and if there were any special items on it.

Thanks

Subject: just a little more and you’ll have what you need.

Brian’s suggestion is the most efficient method. You just grab that line from the view and put in your report. You then just need a little more additional code to turn that line into a link back to the original document.