Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

@DBlookup in LotusScript

Posted on 2000-04-16
3
Medium Priority
?
1,796 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 200 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
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
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

963 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