Solved

@DBlookup in LotusScript

Posted on 2000-04-16
3
1,583 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
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.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

863 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now