Solved

@DBlookup in LotusScript

Posted on 2000-04-16
3
1,648 Views
Last Modified: 2013-12-18
Heya,

Is there anyway to do a lookup to a notes database using script?

I cant seem to find an all encompassing command to carry it out.

I need to rewrite this code into script...

test := @DbLookup("Notes":"NoCache";"server:database";"Notes_GDPLogonID";Manager;2);
FIELD ManagersNotesName := @MiddleBack(test;"@";"~");
0
Comment
Question by:prenexus
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
Simon_Hendry earned 50 total points
ID: 2721762
' Depending on where you are calling this code from will determine how
'exactly you will need to get the handle to the current document , I will
'presume that the ManagersNotesName is a field on the currently open
'document..

'Also replace the Column2FieldName with the name of the field that is used
'to build the second view for the "Notes_GDPLogonID" , this maybe a
'formula if it is then further code maybe required , so just tell me if it is
' and i can give you the additional code

Dim Wspace As New NoreuiWorkspace
Dim UiDoc As NotesuiDocument
Dim ThisDoc As NotesDocument
Dim ThisDB As NotesDatabase
Dim SearchView As NotesView
Dim SearchDoc As NotesDocument
Dim PlaceTildaisAt As Integer

Set UiDoc = Wspace.CurrentDocument
Set ThisDoc = UiDoc.Document

Set ThisDB = ThisDoc.ParantDatabase
' if the database is not the current one then use this line not the above one
' Set ThisDB = New NotesDatabase("ServerName","DBPATH")

Set SearchView = ThisDb.GetView("Notes_GDPLogonID")
Set SearchDoc = SearchView.Getdocumentbykey(ThisDoc.Manager(0))

' If we didn't find the document then end now
If SearchDoc is Nothing Then Exit Sub

PlaceAtisAt = Instr(SearchDoc.Column2FieldName(0),"@")
PlaceTildaisAt = Instr(SearchDoc.Column2FieldName(0),"~")

Doc.ManagerNotesName = Mid(SearchDoc.Column2FieldName(0),PlaceAtisAt+1,PlaceTildaisAt - PlaceAtisAt )

' Now you know why sometime macro is much faster !!
0
 
LVL 3

Expert Comment

by:Simon_Hendry
ID: 2721767
NoreuiWorkspace should read NotesuiWorkspace in the first line .. Sorry typo
0
 

Author Comment

by:prenexus
ID: 2724761
Thats exactly what I wanted to do!

Perfect answer!

Now that I can access the doc through the script (rather than just the views that are created), Ive managed to get the actual field I need instead of using the middleback code.

Thanks very much!

Mat
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question