Filling in computed fields with WebQueryOpen

Hello, I wrote the following code, hoping that it would help me get Person Document values from the Domino Directory on the server.

What am I doing wrong?

Sub Initialize

Dim Session As New NotesSession

Dim Directory As NotesDatabase

Dim view As NotesView



Dim PersonDoc As NotesDocument

Dim thisDoc As NotesDocument



Set thisDoc = Session.DocumentContext

Set Directory = Session.GetDatabase("myServer" , "names.nsf")

Set View = Directory.GetView("People")

Call View.FTSearch("FIELD FullName= " + Session.CommonUserName)



Set PersonDoc = View.getFirstDocument



thisDoc.FullName = PersonDoc.GetItemValue( "Fullname" )

thisDoc.CompanyName = PersonDoc.GetItemValue( "CompanyName" )



thisDoc.OfficeStreetAddress = PersonDoc.GetItemValue( "OfficeStreetAddress" )

thisDoc.OfficeCity = PersonDoc.GetItemValue( "OfficeCity" )

thisDoc.OfficeState = PersonDoc.GetItemValue( "OfficeState" )

thisDoc.OfficeZIP = PersonDoc.GetItemValue( "OfficeZIP" )

thisDoc.OfficeCountry = PersonDoc.GetItemValue( "OfficeCountry" )

End Sub

Subject: This is an awfully expensive transaction…

Between searches and all you are trying to do here.

You might be better off doing DBLookups in the form using the name as they key and using the ($VIMPeople) view instead.

Or just use the ($VIMPeople) view and do a lookup by key. The serach will kill you on the web.

Subject: Directly in the field, or in the webQueryOpen?

Subject: RE: Directly in the field, or in the webQueryOpen?

In the field, I would kill the webqueryopen, but that is just my preference.

Subject: The problem is in this line "Call View.FTSearch(“FIELD FullName= " + Session.CommonUserName)”

That is returning the Servers Name. It should be Set uname = new NotesName(Session.EffectiveUserName)

Call View.FTSearch("FIELD FullName= " + uname.Common)

Subject: Thank you Bill. I’ll try that!