Ich habe ein kleines Problem mit meinem Agenten.
Er soll automatisch Daten zu Testzwecken erstellen.
Er befüllt auch brav die Felder nur leider speichert er die Dokumente nicht. Er gibt bei doc.save jedes Mal False zurück.
Hier der Code:
Code
Set db = ses.CurrentDatabase
Set vw_pers=db.GetView("VW-Person\Detailliert")
Set vw_org=db.GetView("(VW-Organization-docid)")
i=10
Set fo=db.GetForm("FO-Event")
y =1
Set organization=vw_org.GetFirstDocument
Set person=vw_pers.GetFirstDocument
k=1
s=1
While i>0
Set doc= New NotesDocument(db)
doc.Form = "event"
If y=14 Then
y=1
End If
Call doc.ReplaceItemValue("Evt_TypeTX",typ(y))
If s=5 Then
s=1
End If
Call doc.ReplaceItemValue("Evt_StatusTX",status(s))
Call doc.ReplaceItemValue("Evt_TitleTX",status(s))
Call dateTime.AdjustMonth(2)
Call doc.ReplaceItemValue("Evt_DateFromDT",dateTime)
Call dateTime.AdjustMonth(1)
Call doc.ReplaceItemValue("Evt_DateToDT",dateTime)
If (organization Is Nothing) Then
Set organization= vw_org.GetFirstDocument
End If
org=organization.UniversalID
Call doc.ReplaceItemValue("Evt_OrganizationUNIDTX",org)
Set organization = vw_org.getnextdocument(organization)
If (person Is Nothing) Then
Set person =vw_pers.GetFirstDocument
End If
contact=person.UniversalID
Call doc.ReplaceItemValue("Evt_ContactPersonUNIDTX",contact)
Set person=vw_pers.GetNextDocument(person)
If (person Is Nothing) Then
Set person=vw_pers.GetFirstDocument
End If
contact = person.UniversalID
Call doc.ReplaceItemValue("Evt_ResponsiblePersonUNIDTX",contact)
Set person=vw_pers.GetNextDocument(person)
Call doc.ReplaceItemValue("Evt_NeededPerformersNO",3)
If k=5 Then
k=1
End If
Call doc.ReplaceItemValue("Evt_EducationDepartmentTX",lok(k))
Call doc.ReplaceItemValue("Evt_NumberOfPersonsNO",5)
k=k+1
i=i-1
y=y+1
s=s+1
doc.saveoptions="1"
Messagebox doc.Save(True,False)
Wend
Alles anzeigen
Kann mir irgendjemand helfen???
Danke im Vorraus,
Panisha