Looping Help

Hi,

I’m not sure if this is a looping error or something else, but…

I am trying to create an agent that will present the user with a dialog box and upon the selection from the dialog box, append the selection to a field on the document. I am just testing my code at the moment, but see below for an example. It returns the dialogbox values ok, and also returns the value from a field on the document ok (Liaison Branches). However when I try to append the value from the text list to a field on the document (Doc.LiaisonBranches), it doesn’t seem to do anything! Can anyone advise?

Sub Initialize

Dim s As New NotesSession

Dim db As NotesDatabase

Dim docCollection As NotesDocumentCollection

Dim doc As NotesDocument 

Dim ws As New NotesUiWorkSpace

Dim tempdoc As NotesDocument

Dim item As NotesItem



Set db = s.CurrentDatabase

Set docCollection = db.UnprocessedDocuments

Set doc = docCollection.GetFirstDocument 

Set tempdoc = db.CreateDocument

tempdoc.form = "CheckboxRetickDialog"

Set item = doc.GetFirstItem( "Approvals" )



Call ws.Dialogbox("CheckboxRetickDialog", True,True, False, False, False, False, "Select", tempdoc)

Forall values In tempdoc.SubmissionSelection

	If values = "Liaison Branch" Then

		Messagebox Values

		Messagebox Doc.LiaisonBranches(0)

		Call item.AppendToTextList("Liaison Branch: " + Doc.LiaisonBranches(0))

	Else

		Messagebox "Something else"

	End If

End Forall

End Sub

Subject: Looping Help

Please disregard, I forgot to add a doc.save!!