SelectDocument

Hi,Let me describe the scenario, I have a address picker(like the one in Names.nsf ). it is supposed to picks the first document with the key we select from the view and it is working perfectly, the only exception is as follows

In my view I have a document under multiple categories say for example

I have a document under category Apple and Mango, so when i click the letter “A” in the address picker, it gets the document under category mango, but the UIview.selectdocument method which is used to show the document in the view shows the document under category Mango.

Is there any way to handle this issue?

Thanks

Thomas

This is the code:

Function FindItemInView(thisRow As Integer)

Dim ws As New notesuiworkspace

Dim uidb As notesuidatabase

Dim uiview As notesuiview

Dim note As notesdocument

Dim strKey(0) As String

Dim uidoc As notesuidocument

Dim AlphList As Variant	

Dim member As Variant



Set uidb = ws.currentdatabase



Pview = ProfileDoc.Pview

If pview(0) = "BA" Then

	Msgbox "Alphabetic picker is not supported in this view."

End If





Set view = db.getview(Pview(0))



If uidb Is Nothing Then Exit Function



AlphList = AlphForm.getitemvalue("AlphList")



member = Evaluate(|@GetMembers(AlphList; | & ThisRow & |)|, AlphForm)



strKey(0) = member(0)



Call strToArray(strKey(0))

Forall x In sArray			

	Set note = view.getdocumentbykey(Trim(x),False)

	If Not(note Is Nothing) Then

		Call uidb.openview(Pview(0))

		Set uiview = ws.currentview

		Call uiview.selectdocument(note)

		Exit Function

	End If		

End Forall

End Function

============

Function strToArray(getString As Variant)

Dim i As Variant

'using -1 in these cases because the array begins with 0, not 1

Redim sArray(Len(getString)-1)

For i = 1 To Len(getString)

	sArray(i-1) = Mid$(getString, i, 1)

Next



strToArray = sArray

End Function