Solved

@DBlookup in LotusScript

Posted on 2000-04-16
3
1,550 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
Comment Utility
' 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
Comment Utility
NoreuiWorkspace should read NotesuiWorkspace in the first line .. Sorry typo
0
 

Author Comment

by:prenexus
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

762 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

10 Experts available now in Live!

Get 1:1 Help Now