Hi,
How can you lookup a view and get documents by a key....then return the values in certain columns
and store them in some sort of array because the getdocumentbykey may return more than 1 document....but here is the main
problem i have....some of the columns in the view have the property "Show multiple values as seperate entries" enabled and this starts causing problems
when you start using methods such as doc.columnvalues(0) because with a column set with that property for eg the following script results in the debugger returning:
Dim viewview As NotesView
Dim viewdoc As NotesDocument
Set viewview = currentDb.GetView("AllPersonV")
j = viewview.FTSearch( tempdoc.SMStaffName(0), 0 )
If j > 1 Then
Set viewdoc = viewview.GetFirstDocument
counter% = 0
Dim column As NotesViewColumn
Redim people(j-1) As Variant
Redim people2(j-1) As Variant
Redim people3(j-1) As Variant
Redim people4(j-1) As Variant
Redim people5(j-1) As Variant
Redim people6(j-1) As Variant
Dim currentpeople As Variant
Dim currentpeople2 As Variant
Dim currentpeople3 As Variant
Dim currentpeople4 As Variant
Dim currentpeople5 As Variant
Dim currentpeople6 As Variant
'Get the values - Role & Site & Division
If tempdoc.SMStaffRole(0) = "SPO" Then
For i = 0 To j-1
currentpeople = viewdoc.ColumnValues( 4 )
people( counter% ) = currentpeople
currentpeople2 = viewdoc.ColumnValues( 5 )
people2( counter% ) = currentpeople2
currentpeople3 = viewdoc.ColumnValues( 6 )
people3( counter% ) = currentpeople3
currentpeople4 = viewdoc.ColumnValues( 8 )
people4( counter% ) = currentpeople4
currentpeople5 = viewdoc.ColumnValues( 9 )
people5( counter% ) = currentpeople5
currentpeople6 = viewdoc.ColumnValues( 10 )
people6( counter% ) = currentpeople6
counter% = counter% + 1
Set viewdoc = viewview.GetNextDocument(viewdoc)
Next
End If
Debugger returns:
People
[0]
- [0] All SPOs
- [1] All POs
- [2] All POs
- [3] All POs
- [5] All POs
[1]
- [0] All SPOs
- [1] All POs
- [2] All POs
- [3] All AAs
But in my view I can see All Pos in a column for one of the documents found by the key and All AAs for the next document found in the key when really I was expecting
People
[0]
- [0] All POs
[1]
- [0] All AAs
but when you look at the view you can see that only one value is in that column for that documentbykey...how can i overcome this bug...which i cant seem to
get round
I have to set the column properties like this as my view selection criteria involves 2 different forms and i want to see all the names of people in the fields in these documents
The driving force of the view is the first column which has the property "Show multiple values as seperate entries" enabled and has the following formula, where Div inidcates fields from one document and Tea indicates fields from another document - as specified in the view selection criteria
aco := @If(DivACPO = "";"";DivACPO + "~ACO");
acopa := @If(DivACPOSec = "";"";DivACPOSec + "~ACO PA");
am := @If(DivAM = "";"";DivAM + " ~AM");
aam := @If(DivAAM = "";"";DivAAM + "~AAM");
dspo := @If(DivSPO= "";"";DivSPO + "~SPO");
dpo :=@If(DivPO= "";"";DivPO + "~PO");
dpso := @If(DivPSO= "";"";DivPSO + "~PSO");
dtpo := @If(DivTPO= "";"";DivTPO + "~TPO");
dtemppo := @If(DivTempPO= "";"";DivTempPO + "~Temp/Agency PO");
doa := @If(DivOA= "";"";DivOA + "~OA");
dsaa := @If(DivSTA= "";"";DivSTA + "~SAA");
daa := @If(DivTA = "";"";DivTA + "~AA");
dotheracostaff := @If(DivAdminOtherStaff= "";"";DivAdminOtherStaff + "~Other Staff");
dtempadmin := @If(DivTempAdmin= "";"";DivTempAdmin+ "~Temp/Agency Admin");
spo := @If(TeaSPO = "";"";TeaSPO + "~SPO");
po := @If(TeaPO = "";"";TeaPO + "~PO");
pso := @If(TeaPSO = "";"";TeaPSO + "~PSO");
tpo := @If(TeaTPO = "";"";TeaTPO + "~TPO");
temppo := @If(TeaTempPO = "";"";TeaTempPO + "~Temp/Agency PO");
oa := @If(TeaOA = "";"";TeaOA+ "~OA");
saa := @If(TeaSTA = "";"";TeaSTA+ "~SAA");
aa := @If(TeaTA = "";"";TeaTA+ "~AA");
otherstaff := @If(TeaOtherStaff = "";"";TeaOtherStaff+ "~Other Staff");
tempadmin := @If(TeaTempAdmin = "";"";TeaTempAdmin+ "~Temp/Agency Admin");
@Trim(aco : acopa : am : aam : dspo : spo : dpo : po : dpso : pso : dtpo : tpo : dtemppo : temppo : doa : oa : dsaa : saa : daa : aa : dotheracostaff : otherstaff : dtempadmin : tempadmin)
Can someone please help, as i hope i have provided enough information for you to assist me.
Thanks in advance

Views and Columns & Property (Nadeem Shaikh 5.Jul.04)
. . 