Problem creating search when multiple values selected in LotusScript

I hope someone can help me. I have a view in a Help Desk database which shows all the technicians, if the calls are open, closed, or suspended, and all the tickets under the correct status. I have an Excel spreadsheet that is being created by an Action Button that asks the user many questions like if they want to see all tickets that are open, closed, or suspended, the name of the technician and the dates that the calls are opened. Then, a spreadsheet returns all the corresponding data. I took code from another similar report and made it work if the user chooses one option of everything. The problem comes in when I want to return multiple technicians. On the dialog box form, I made the technician field accept multiple values, but I cannot get the agent to work. When I do, a “:” is always appended before the first technician name. I can’t seem to get this right.

Here is the error returned:

Notes error: Formula Error (Status = “Open” & CreatedOn >= @TextToTime(“11/18/2008” & CreatedOn <= @TextToTime(“2/18/2009”) & (Technician = : “Adam User/Company” : “Brad User/Company”))

Here is the code for this one part:

If Not docDlg.Technician(0) = ""   Then

	

	Dim totalTechs As Integer

	Dim techs As Variant

	



	

	If Not docDlg.Technician(1) = "" Then

		

		

		Dim item As NotesItem

		Set item = docDlg.GetFirstItem( "Technician" )

		

		Dim counter As Integer

		counter% = 0

		

		Forall v In item.Values

			

							techs = techs + { : " } + docDlg.Technician(counter%)  & {"} 

			counter% = counter% + 1

		End Forall

		x4 = "(Technician = " + techs + ")"

	Else

		x4 = x4 + { Technician = "} & docDlg.Technician(0) & {" } 

	End If

	If  Not docDlg.CatLevel1(0) = ""  Then

		szSelectionFormula4 = x4 & " & " 

	Else

		szSelectionFormula4 = x4

	End If		

End If 

’ End If

Subject: I think the problem is

Notes error: Formula Error (Status = “Open” & CreatedOn >= @TextToTime(“11/18/2008” & CreatedOn <= @TextToTime(“2/18/2009”) & (Technician = : “Adam User/Company” : “Brad User/Company”))

That the last section of the built up string should look like this

(Technician = “Adam User/Company” : “Brad User/Company”))

You have a extra : after Technician = this is the problem.

/Fredrik

Subject: Right, but how do I do that through the code?

That’s what I can’t figure out.

Subject: Or maybe (Technician = “Adam User/Company” | Technician = “Adam User/Company”)

Subject: How do I remove the extra : or |?

I’m not sure how to remove that

Subject: A shot into the dark

you should search for someone in the know about Lotusscript …

  • The Forall thing looks like the loop doing the last parameter

  • there is counter% as variable to decide which run inside Forall you are on already there.

My guess would be to replace this:

techs = techs + { : " } + docDlg.Technician(counter%) & {"}

by that

If counter% = 0 then

techs = techs + { " } + docDlg.Technician(counter%) & {"}

else

techs = techs + { : " } + docDlg.Technician(counter%) & {"}

endif

Actually such a process should start with trying to figure out what search would work, first, and change the code afterwards - I still think you should hire a developer.

Best of luck.