Quick edit document link

Jake Howlett, 9 May 2001

Category: Views; Keywords: edit document

When in a view in the Notes client it is easy to open a document in edit mode. You can either press Ctrl + E or right click the document and choose Edit. In the browser these are not options. Your standard link simply opens the document in read mode.

When you know you want to edit a document straight away, having to open the document and then find the edit link can be annoying and slow if you only have a dial-up connection.

Simple idea: Why not have two links in your view. One to open the document and one to edit it. The only difference being whether the link ends in "?EditDocument" or "?OpenDocument".

Consider the picture below. This is a screenshot of CodeStore's "Draft" view. This is where I put ideas before I get around to turning them in to articles. More often than not I know I want to go straight in to edit mode from this view. That is what the little pencil icon is for. If I want to read the document I use the normal blue link, whereas, if I want to edit the document, I simply click the pencil's image.

Image

How to do this:

There are two approaches. Which we use depends on whether the view in question is being treated as HTML as in the picture below:

Image



If you are using HTML then in the column that you want the edit link to appear add the following:

"<a href=\"" + @Text(@DocumentUniqueID) + "?EditDocument\"><img src=\"/icons/vwicn012.gif\" width=\"13\" height=\"11\" alt=\"Edit!\""></a>"

If you aren't using HTML then add a new column and in the formula add:

"[<a href=\"" + @Text(@DocumentUniqueID) + "?EditDocument\"><img src=\"/icons/vwicn012.gif\" width=\"13\" height=\"11\" alt=\"Edit!\""></a>]"


Notice in the above link that I have done away with the full relative URL ("/dir/dbname.nsf/"). If we wanted to do this in a view we would have to compute it and this would lead to index/performance issues. You could store the path in a field in the document but then if the DB moves all these fields will be out of date. Instead, the above link assumes we are at the same level of the DB's structure as the view and so we can start from there, simply by using the DocID of that particular document.

Conclusion

You could of course do away with this and simply use the form property "Automatically enable Edit Mode". This way all documents would be in edit mode when you opened them, no matter where from.

However, I always prefer to give the user as many options as possible. Let them decide how they want to open the document...