Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

@DBlookup in LotusScript

Posted on 2000-04-16
3
Medium Priority
?
1,768 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

718 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