Das Notes Forum

Domino 9 und frühere Versionen => ND6: Entwicklung => Thema gestartet von: bikerboy am 06.10.06 - 10:11:57

Titel: Create Document
Beitrag von: bikerboy am 06.10.06 - 10:11:57
Hi Leute ich habe ein Problem mit der Create Methode, aber erstmal gibt es ein bisschen Code

Code
For i = 1 To intDurchlaeufe
		
		Call dtPayableDate.AdjustMonth(intStep )
		
		Set newDoc = db.CreateDocument
		newDoc.personName = strPersonName
		newDoc.amount = curAmount
		newDoc.once = strOnce
		newDoc.repeat = strRepeat
		newDoc.kindofCost = strKindOfCost
		newDoc.payableDate = dtPayableDate.localTime
		newDoc.Form = "PersonForecast"
		newDoc.amountsuffix = strSuffix
		
		Call newDoc.Save(True,False)
	Next

Also wie ihr seht haben wir hier eine Schleife die mir schön Documente erzeugt.

Mein Problem ist, dass sie keine FeldEigenschaften setzt. Also zum Beispiel bei :

"dtPayableDate" würde ich gerne ein Datumsfeld erzeugen oder bei
"curAmount" ein Numerisches Feld.

Deklariert sind diese Variablen wie folgt :

Code
Dim dtPayableDate As NotesDateTime
Dim strPersonName As String
Dim strLifetime As String
Dim strRepeat As String
Dim strOnce As String
Dim strKindofCost As String
Dim curAmount As Variant	

hoffe ihr könnt mir weiterhelfen.

Ich bedanke mich schon mal für eure Hilfe
Titel: Re: Create Document
Beitrag von: m3 am 06.10.06 - 10:19:53
Hast Du die Datentype der Felder im Form "PersonForecast", welches Du im Designer angelegt hast, auch entsprechend angegeben?
Titel: Re: Create Document
Beitrag von: Glombi am 06.10.06 - 10:21:51
Anstelle von
newDoc.payableDate = dtPayableDate.localTime
ein
newDoc.payableDate = dtPayableDate.LSLocalTime

In curAmount muss eine Zahl stehen - leider sehe ich nicht wo der Wert herkommt.

Du kannst aber auch
newDoc.amount = CCur(curAmount)

verwenden.


Andreas
Titel: Re: Create Document
Beitrag von: bikerboy am 06.10.06 - 10:44:18
@ m3

Danke für den Tip mit der Maske. Ich hatte bis jetzt einfach ne andere Maske genommen. -> Anfängerfehler

@Glombi

Der Tip für die Zeit war super, das klappt schon mal, aber bei der Konvertierung schmeisst er mir nen Typemismatch raus.... ärgerlich aber war...