Domino 9 und frühere Versionen > Entwicklung

antwortdokument als uidoc aus dem backend erstellen?

<< < (3/4) > >>

koehlerbv:
Bitte opfere Grossbuchstaben an den richtigen Stellen für uns - und gib' aussagekräftige Fehlermeldungen an und Code, wo notwendig.

Bernhard

OCS:
Schuldigung, das mit nur klein schreiben ist ne schlechte Angewohnheit! Also, ich leser mit den CommonUserName aus der Session in einen String aus und möchte diesen String jetzt irgendwie in eine Variable vom Datentyp Variant kopieren.

koehlerbv:
Das sollte kein Problem darstellen. Code ?

OCS:
Sub Initialize
   Dim uidoc As notesuidocument
   Dim session As notessession
   Set session = New notessession
   Dim item As notesitem
   Dim workspace As notesuiworkspace
   Dim rtitem As notesrichtextitem
   Dim db As NotesDatabase
   Set workspace = New notesuiworkspace
   Dim collection As NotesDocumentCollection
   Dim doc As NotesDocument
   Dim currentdoc As NotesDocument
   Dim problem As String
   Set uidoc = workspace.currentdocument
   Dim temp As String
   Dim view As notesview
   Dim aktivid As String
   Dim aktivdoc As notesuidocument
   Dim newdoc As notesdocument
   Dim KDNR As notesitem
   Dim name1 As notesitem
   Dim AUFPOS As notesitem
   Dim CLART As notesitem
   Dim CLID As notesitem
   Dim CPART As notesitem
   Dim CPBEZ As notesitem
   Dim CPENDE As notesitem
   Dim CPOCSSB As notesitem
   Dim CPREADER As notesitem
   Dim CPSTATUS As notesitem
   Dim IPSS As notesitem
   Dim Kunde As notesitem
   Dim aufnr As notesitem
   Dim user As String
   
   
   Set currentdoc = uidoc.Document 
   Call uidoc.save   
   aktivid = uidoc.fieldgettext("aktiv_id")
   
   Call uidoc.save
   'Call uidoc.close
   
   
   Set db = session.Getdatabase("SCHMITT01/SCHMITT", "aktiv\aktiv003.nsf", False)
   Set view = db.getview ("ViewActionsUNID")
   Call view.Refresh
   Set collection = view.getalldocumentsbykey(aktivid)
   Set doc = collection.GetFirstDocument()
   Print collection.count
   
   -->      user = session.CommonUserName      Stimmt noch
   
   
   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" )

   Set CPOCSSB = user   --> Das lässt schon der Designer nicht zu!!!


   Set CPREADER = doc.Getfirstitem( "CPREADER" )
   Set CPSTATUS = doc.Getfirstitem( "CPSTATUS" )
   Set IPSS = doc.Getfirstitem( "IPSS" )
   Set KUNDE = doc.Getfirstitem( "KUNDE" )
   
   [
   Set  newdoc = db.createDocument
   
   Call newdoc.MakeResponse( doc )
   newdoc.Form = "aktion"
   Call newdoc.save (True, True)
   
   Set KDNR = newdoc.ReplaceitemValue( "KDNR", KDNR )
   Set NAME1 = newdoc.ReplaceitemValue( "NAME1", NAME1 )
   Set AUFNR = newdoc.ReplaceitemValue( "AUFNR", AUFNR )
   Set AUFPOS = newdoc.ReplaceitemValue( "AUFPOS", AUFPOS )
   Set CLART = newdoc.ReplaceitemValue( "CLART", CLART )
   Set CLID  = newdoc.ReplaceitemValue( "CLID", CLID )
   Set CPART = newdoc.ReplaceitemValue( "CPART", CPART )
   Set CPBEZ  = newdoc.ReplaceitemValue( "CPBEZ ", CPBEZ  )
   Set CPENDE = newdoc.ReplaceitemValue( "CPENDE", CPENDE )
   Set CPOCSSB = newdoc.ReplaceitemValue( "CPOCSSB", CPOCSSB )
   Set CPREADER = newdoc.ReplaceitemValue( "CPREADER", CPREADER )
   Set CPSTATUS = newdoc.ReplaceitemValue( "CPSTATUS", CPSTATUS )
   Set IPSS = newdoc.ReplaceitemValue( "IPSS", IPSS )
   Set KUNDE = newdoc.ReplaceitemValue( "KUNDE", KUNDE )
   
   
   Call newdoc.save (True, True)
   workspace.EditDocument True,newdoc
'Call newdoc.Save( False, False )
   'workspace.EditDocument True,newdoc
   
' wichtig. Vergisst man schnell:
   
   
   '
   
End Sub

Semeaphoros:

--- Zitat --- Set CPOCSSB = user   --> Das lässt schon der Designer nicht zu!!!
--- Ende Zitat ---

Logisch, jedes Objekt muss mit New instanziiert werden, es sei denn, man bekommt das von einem anderen Objekt erledigt. Hier also zuerst:

Set CPOCSSB = New NotesItem

Das steht in der Hilfe unter NotesItem und das sollte man unbedingt mal nachgelesen haben.

Navigation

[0] Themen-Index

[#] Nächste Seite

[*] Vorherige Sete

Zur normalen Ansicht wechseln