Domino 9 und frühere Versionen > ND8: Entwicklung

Text kann nicht in eine Zahl umgesetzt werden

<< < (5/5)

Bruce Willis:
Sie haben wie üblich "nix gemacht". ;)
Ich vermute, dass ein Datum-Feld (oder ein Textfeld mit Datum-Umwandlung) deren lokalen Regionalsettings nicht versteht.
Wie kann man so ein Feld per Script finden?

Peter Klett:
Jetzt habe ich es ausprobiert, das ließ mir denn nun doch keine Ruhe.

Eine Maske mit einem Zahlenfeld und einem Datumsfeld, dort wirres Zeug eingetippt und gespeichert, es kommt genau die von Dir genannte Fehlermeldung.

Das Item auf Isarray abzufragen, hilft nichts, denn auch im Fehlerfall ist das Item ein Array, aber so geht es


--- Code: ---Sub Querysave(Source As Notesuidocument, Continue As Variant)
Dim doc As NotesDocument
Set doc = Source.Document
Forall item In doc.Items
If Not Isarray (doc.GetItemValue (item.Name)) Then
Msgbox item.Name
End If
End Forall
End Sub

--- Ende Code ---

oder so


--- Code: ---Sub Querysave(Source As Notesuidocument, Continue As Variant)
Dim doc As NotesDocument
Set doc = Source.Document
Forall item In doc.Items
If item.Text = "ERROR: " Then
Msgbox item.Name
End If
End Forall
End Sub

--- Ende Code ---

Und das funktioniert auch, wenn Richtextfelder in der Maske sind.

EDIT:

Wenn Du es so machst, werden Richtextfelder auch als Fehler ausgewiesen. Damit hätten wir den Einwand auch noch geklärt ...


--- Code: ---Sub Querysave(Source As Notesuidocument, Continue As Variant)
Dim doc As NotesDocument
Set doc = Source.Document
Forall item In doc.Items
If Not Isarray (item.Values) Then
Msgbox item.Name
End If
End Forall
End Sub

--- Ende Code ---

Bruce Willis:

--- Zitat von: Peter Klett am 07.06.13 - 07:21:30 ---...so geht es


--- Code: ---Sub Querysave(Source As Notesuidocument, Continue As Variant)
Dim doc As NotesDocument
Set doc = Source.Document
Forall item In doc.Items
If Not Isarray (doc.GetItemValue (item.Name)) Then
Msgbox item.Name
End If
End Forall
End Sub

--- Ende Code ---

oder so


--- Code: ---Sub Querysave(Source As Notesuidocument, Continue As Variant)
Dim doc As NotesDocument
Set doc = Source.Document
Forall item In doc.Items
If item.Text = "ERROR: " Then
Msgbox item.Name
End If
End Forall
End Sub

--- Ende Code ---

Und das funktioniert auch, wenn Richtextfelder in der Maske sind.


--- Ende Zitat ---

Hallo Peter,

VIELEN DANK !!!

Die erste Variante bringt das Popup bei einem Feld (siehe Screenshot), obwohl alles in Ordnung ist.
Weißt Du, woran es liegen könnte?

Gruß
Leo

Peter Klett:
Systemseitige Items können schon einmal andere Strukturen haben. Wenn Du selbst keine Items mit $ als ersten Buchstaben hast, würde ich die einfach von der Überprüfung ausschließen ...

Forall item In doc.Items
   If Left (item.Name, 1) <> "$" Then
      If Not Isarray (doc.GetItemValue (item.Name)) Then

Bruce Willis:
Hallo Peter,

vielen Dank !!!

Gruß
Leo

Navigation

[0] Themen-Index

[*] Vorherige Sete

Zur normalen Ansicht wechseln