Domino 9 und frühere Versionen > ND8: Entwicklung

Probleme mit Dialogboy

<< < (2/3) > >>

m3:

--- Zitat von: zapfbay am 12.04.10 - 08:35:24 ---Habe den Quelltext jetzt mal ein bisschen geändert, bekomme jetzt aber in Notes folgende Fehlermeldung: Falscher Datentyp in Methode RunStkCoerceVal: STRING wurde gefunden, NULL wurde erwartet???!?!?!

--- Ende Zitat ---
Dann wäre es nicht schlecht, wenn Du zumindest den Code, in dem "RunStkCoerceVal" aufgerufen wird, hier angibst.


--- Zitat ---'Diese Zeile ist für den Fehler verantwortlich - aber warum???
   sPreis = NotesDoc2.FieldGetText("fdArtikelPreis")
--- Ende Zitat ---

Vielleicht weil Du NotesDoc2 als NotesDocument deklarierst, "FieldGetText" aber eine Methode eines NotesUIDocument ist?

zapfbay:
Ich hab das jetzt mal geändert! Mein letztes großes Problem ist, das "itempreis" jetzt ins Feld "sField2" zu bekommen...

Function ArtikelZugriff(sZeile As String, sKategorie As String) As Integer
   Dim ws As New NotesUiWorkspace
   Dim session As New NotesSession
   Dim db As NotesDatabase
   Dim note As NotesDocument
   Dim uiNote As NotesUIDocument
   Dim uiDoc As NotesUIDocument
   Dim xArray As Variant
   Dim sText As String
   Dim sView As String
   Dim oView As NotesView
   Dim notesDoc As NotesDocument
   Dim notesDoc2 As NotesDocument
   Dim sArtText As String
   Dim rtitem As NotesRichTextItem
   Dim rtitem2 As NotesRichTextItem
   Dim nItem As Notesitem
   Dim newdoc As NotesDocument
   Dim sField As String
   Dim sField2 As String
   Dim item As NotesItem
   Dim preisitem As NotesItem
   Dim sArtikelPreis As String
   
   Set UiNote = ws.CurrentDocument
   sFirma = UiNote.FieldGetText("fdProduktFirma")
   If sFirma = "" Then
      sFirma = "ZAPF"
   End If
   
   sField = "fdArtikel_" + sZeile
   sField2 = "fdPreis_" + sZeile
   
   sView = "viwArtikel"
   
   If sFirma = "ZAPF" Then
      sView = "viwArtikelZ"
   Else
      sView = "viwArtikelK"
   End If
   
   
   ArtikelZugriff = 0
   
   Set db = session.CurrentDatabase
   Set oView = db.GetView("viwArt")
   If sView = "viwArtikelZ" Or sView = "viwArtikelK" Then
      xArray = ws.picklistStrings(PICKLIST_CUSTOM, False, db.server, db.FilePath, sView, _
      sKategorie, "Bitte wählen Sie einen Artikel aus", 5, "")
   Else
      xArray = ws.picklistStrings(PICKLIST_CUSTOM, False, db.server, db.FilePath, sView, _
      sKategorie, "Bitte wählen Sie einen Artikel aus", 5, sFirma)
   End If
   
   If Isempty(xArray) Then Exit Function
   
   Set NotesDoc = oView.GetDocumentByKey(xArray(0))
   
   If Notesdoc Is Nothing Then Exit Function
   
   Set item = Notesdoc.GetFirstItem("fdArtikelHinweis")
   Set rtitem = Notesdoc.GetFirstItem("fdArtikelTextRTF")
   Set rtitem2 = Notesdoc.GetFirstItem("fdTechBeschreibung")
   Set preisitem = Notesdoc.GetFirstItem("fdArtikelPreis")
   If rtitem2.text <> "" Then
      Call rtitem.AddNewLine(1)
      Call rtitem.AppendRTItem(rtitem2)
   End If
   
   Set NotesDoc2 = db.GetProfileDocument("Artikelauswahl", session.CommonUserName)
   Call NotesDoc2.removeItem("fdArtikelTextRTF")
   Call NotesDoc2.removeItem("fdArtikelHinweis")
   Call NotesDoc2.removeItem("fdArtikelPreis")   
'   Set NotesDoc2 = db.CreateDocument
   Call NotesDoc2.CopyItem( rtitem, "fdArtikelTextRTF" )
   Call NotesDoc2.CopyItem( item, "fdArtikelHinweis" )
   Call NotesDoc2.CopyItem( preisitem, "fdArtikelPreis" )   
   
   success = ws.Dialogbox("faRTF", True, True, False, False, False, False, "Artikelauswahl", NotesDoc2, True, False)
   
   Call uinote.Gotofield(sField)
   Call UiNote.Paste
   
'   Call UiNote.FieldSetText("fdPreis_"+sZeile, sArtikelPreis)
   
   ArtikelZugriff = 1
End Function

m3:

--- Zitat von: zapfbay am 12.04.10 - 09:56:20 ---Ich hab das jetzt mal geändert! Mein letztes großes Problem ist, das "itempreis" jetzt ins Feld "sField2" zu bekommen...
--- Ende Zitat ---
Das wird schwer, nachdem Du keine Zeile hast, in welcher das Feld "sField2" befüllt wird ...

zapfbay:
Genau das ist mein Problem. Ich weiß nicht, wie ich den Wert "copyItem(preisitem...." in das Feld Field2 bekomme...

mit
   Call uinote.Gotofield(sField2)
   Call UiNote.Paste

geht's leider nicht - da wird der Inhalt von Item in Field2 geschrieben...

bikerboy:
welches Item meinst du nun wirklich "preisitem" oder "itempreis", weil du "itempreis" gar nicht hast

und befüllen kannst du es doch relativ einfach

call uinote.document.replaceItemValue("<Feldname>", <wert>)

dann kannst du dir das mit dem gotofield sparen, was eh nicht funktionieren würde, wenn das ein verstecktes feld ist.

Navigation

[0] Themen-Index

[#] Nächste Seite

[*] Vorherige Sete

Zur normalen Ansicht wechseln