Domino 9 und frühere Versionen > Entwicklung

form Abfrage per Script

(1/2) > >>

MrMagoo:
Hallo zusammen,

in der Formelsprache gibt es ja folgende Formel zur Abfrage einer Maske um z.B. Tochterdokumente zu erstellen

@If(Form != "Maske1" ;@Prompt([OK];"Failure";"If you want to create ...you have to select an other Mask");@Command([Compose];"";"Mask"))
Ist es auch möglich dies in Script Abzufragen. Also nur wenn ein Dokument einer bestimmten Maske makiert ist, wird das neue Dok erstellt.

Danke

Driri:
Hi,

sollte z.B. so gehen :

Dim ws as New NotesUIWorkspace
Dim uidoc as NotesUIDocument
Dim doc as NotesDocument

Set uidoc = ws.CurrentDocument
Set doc = uidoc.Document

If doc.Form <> "Maske1" Then
   MessageBox...
   Exit Sub
Else
   ...
End If

MrMagoo:
Danke für die Antwort @Driri,
macht er so aber leider nicht, bei
set doc = uidoc.doument  gibt es die Fehlermeldung "Object Variable not set" ich will dies in einer Ansicht benutzen in der dann ein doc ausgewählt ist
Gruß

MrMagoo:
ich bin jetzt mal mit einer collection auf das Dok gegangen, sagt jetzt TypeMismatch bei If doc.Form <> "Maske"  Then

Sub Initialize
   Dim session As New NotesSession
   Dim db As NotesDatabase
   Dim collection As NotesDocumentCollection
   Dim doc As NotesDocument
   
   Set db = session.CurrentDatabase
   Set collection = db.unprocessedDocuments
   Set doc = collection.GetFirstDocument
   If doc.Form <> "Maske"  Then
      Msgbox "Please select an other dok"

   Else
      Msgbox "Geht doch"      
   End If
End Sub

ata:
... noch ne kleine Korrektur

If doc.Form(0) <> "Maske1" Then

ata

Navigation

[0] Themen-Index

[#] Nächste Seite

Zur normalen Ansicht wechseln