Manage Learn to apply best practices and optimize your operations.

Getting a document highlighted in a view

Here's a look at how to get a hold of the back end document when a user selects a document in a view. It's useful for someone wanting to make a LotusScript function that will operate similar to the Copy As New function in the Inbox, but using LotusScript so that only certain fields on the form are copied into the new document. This can be done either for a Notes client or a Web browser. Notes client: The best way to do this is to have the action button run an agent. The agent would run on selected documents. In the agent, start by setting a document collection equal to db.UnprocessedDocuments. This is a handle to the selected document(s). You can get the first doc and you have a handle to the back end doc you want. set collection = db.UnprocessedDocuments set doc = collection.GetFirstDocument Check out the topic -- UnprocessedDocuments property -- in the Notes Help database for more detailed information and sample code. The Web: You can access the session.DocumentContext to determine the document the browser is accessing. By assigning this to a NotesDocument, you can access any of the document's fields and most of the methods and properties. In addition, many CGI variables are available from the document. The following snippet of code gets the browser type and user name. Dim session As New NotesSession Dim doc As NotesDocument Set doc = session.DocumentContext User = doc.Remote_User(0) Browser = HTTP_User_Agent(0) You can check the topic, DocumentContext Property, in the Notes Help database for more detailed information and sample code.

Dig Deeper on LotusScript

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.




  • iSeries tutorials's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...