Manage Learn to apply best practices and optimize your operations.

Get current location doc with LotusScript

Get the current location doc with LotusScript.

Believe it or not, there is no LotusScript method or property to get the current Notes client Location document.

Code below gets a handle to it by poking the Notes.ini "Location" variable's second comma delimited value (the Note ID) and then using it in the GetDocumentbyID database method.


Dim session as New NotesSession
Dim pnab as New NotesDatabase("", "names.nsf")

' Pick out the second argument in Location INI variable (i.e. the Note ID
of current location)
' Following string extraction cannot be done with R5 StrLeft() StrRight()
fcns b/c it won't work in R4 client, hence good old @formula Evaluate() to
the rescue...

CurrLocation$=session.GetEnvironmentString("Location", True)
CurrLocationNoteID=Evaluate( { @Left(@Right("} & CurrLocation$ & {"; ",");
",") } )

Set currlocdoc=pnab.GetDocumentbyID( CurrLocationNoteID(0) )

Dig Deeper on Domino Resources - Part 7

SearchWindowsServer
Search400
  • Favorite iSeries cheat sheets

    Here you'll find a collection of valuable cheat sheets gathered from across the iSeries/Search400.com community. These cheat ...

SearchDataCenter
SearchContentManagement
Close