Type Mismatch Problem

SHowing the Type Mismatch for Forall

Set session = New notessession

set curdb = session.CurrentDatabase

Dim dbdir As New NotesDbDirectory(curdb.Server)

Dim db As NotesDatabase

Set db = dbdir.GetFirstDatabase(DATABASE)

While Not(db Is Nothing)

	Forall a In db.Agents

		Print a.Name			

		If a.Trigger=1 Then

			Set ndoc = curdb.CreateDocument

			ndoc.form = "Second"

			ndoc.AgentName = a.Name

			ndoc.DataBaseName=db.Title

			ndoc.DataBaseTitle= db.FileName

			ndoc.DataBasePath = db.FilePath			

			ndoc.AgentTrigger= "Scheduled Agent"		

			Call ndoc.save(True,True)

		End If

	End Forall

	

	Set db = dbdir.GetNextDatabase

Wend

Subject: Type Mismatch Problem

Perhaps the db in question hasn’t got any agents so db.Agents isn’t an array.

Try:

If isArray(db.Agents) then

Forall a in db.Agents

HTH - Rufus.