Domino 9 und frühere Versionen > Entwicklung

antwortdokument als uidoc aus dem backend erstellen?

<< < (4/4)

koehlerbv:
Jo, und warum redest Du von Variant, wenn Du einem NotesItem-Objekt einen String zuweisen willst ?

Marinero Atlántico:
Wie Bernhard.

Mal so allgemein:

Ich würd an deiner Stelle grundsätzlich die ganzen zu kopierenden Items aus dem Hauptdokument erzeugen.
Wie du ja schon gemacht hast.

--- Code: ---Set NAME1 = doc.getfirstitem("NAME1")
   Set KDNR = doc.Getfirstitem( "KDNR" )
   Set AUFNR = doc.Getfirstitem( "AUFNR" )
   Set AUFPOS = doc.Getfirstitem( "AUFPOS" )
   Set CLART = doc.Getfirstitem( "CLART" )
   Set CLID = doc.Getfirstitem( "CLID" )
   Set CPART = doc.Getfirstitem( "CPART" )
   Set CPBEZ = doc.Getfirstitem( "CPBEZ" )
   Set CPENDE = doc.Getfirstitem( "CPENDE" )

--- Ende Code ---

Und dann mit NotesItem.copyItemToDocument(newDoc, "neuerItemName") arbeiten (echt guter Tipp, wie ich finde, also in keinem Fall überlesen).

In der Praxis sähe das dann etwa so aus:

--- Code: ---NAME1.copyItemToDocument(newDoc, "NAME1")

--- Ende Code ---

Die Namen der Items für die zu kopierenden Dokumente in dem alten Dokument und dem neuen Dokument in je einem Array schreiben. Das gleiche mit den Item-Objekten selbst. Oder in 1 Array aus Structs (letzeres ist wohl besser). Das Struct hat dann 2 String-Member (feldNameNew und feldNameAlt sowie 1 NotesItem).
Das würd ich aber morgen machen.

Axel

OCS:
Sorry, verpeilt! Es geht aber leider  so auch nicht. bekomme beim "Set CPOCSSB = New NotesItem" die Fehlermeldung : Missing Argument to constructor for Notesitem.

Glombi:
Dann siehe doch bitte mal endlich in der Designer Hilfe nach !

Dort steht
Set notesItem = New NotesItem( notesDocument, name$, value  [, specialType% ] )

Parameters
notesDocument
The document on which to create the item.
name$
String. The name of the new item.
value
The value to assign to the new item. The data type of value determines the type of item that Notes creates:
   Data type of value   Resulting notesItem
   String   Text item containing the value (if specialType% is used, may be Names, Readers, or Authors)
   Array of String   Text item containing each element of the value (if specialType% is used, may be Names, Readers, or Authors)
   Long, Integer, Double, Single, or Currency   Number item containing the value
   Array of Long, Integer, Double, Single, or Currency   Number item containing each element of the value
   Variant of type DATE or NotesDateTime   Date-time item containing the value
   Array of Variant of type DATE or array of NotesDateTime   Date-time item containing each element of the value
   NotesItem   Item whose data type matches the NotesItem type and whose value(s) match the NotesItem value(s)
Type conversion occurs as necessary. For example, floating-point numeric items are double precision so a value of type Single is converted to Double prior to storage.
specialType%
Optional. Constant of type integer. Indicates if a text item should be of type Names, Readers, or Authors. Must be one of the following constants: NAMES, READERS, or AUTHORS. To use specialType%, the value parameter must be a string or array of strings.

Andreas

Marinero Atlántico:

--- Code: ---set  CPOCSSB = new NotesItem (doc, "CPOCSSB", user)
[...]
Call newdoc.MakeResponse( doc )
   newdoc.Form = "aktion"
 NAME1.copyItemToDocument(newDoc, "NAME1")
[...] der ganze Rest so ähnlich.
   
   Call newdoc.save (True, True)
   workspace.EditDocument True,newdoc
'Call newdoc.Save( False, False )
   'workspace.EditDocument True,newdoc
   
' wichtig. Vergisst man schnell:
   
End Sub

--- Ende Code ---
und das mit den Arrays ist ne gute Idee.
Und das mit den structs noch eine bessere.

Navigation

[0] Themen-Index

[*] Vorherige Sete

Zur normalen Ansicht wechseln