Domino 9 und frühere Versionen > Entwicklung

Script: aktuell ausgewähltes Dok über Aktion

(1/4) > >>

MadMetzger:
Hi,

wie komme ich in einem Aktionsbutton in einer Ansicht mit Script auf das gerade ausgewählte Dok?

Rob Green:
dazu gibt es die unprocessed Property..

HELP:
This agent script allows a user to approve multiple requisitions at once by processing the currently selected documents in the Requisitions view. UnprocessedDocuments returns the documents currently selected in the view. The script iterates over each document and, if the Approver item contains the current user's name, it sets the Approved item to "Yes."
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()
   While Not(doc Is Nothing)
      Set item = doc.GetFirstItem( "Approver" )
      If item.Contains( session.UserName ) Then
         doc.Approved = "Yes"
         Call doc.Save( False, True )
      End If
      Set doc = collection.GetNextDocument(doc)
   Wend
End Sub

MadMetzger:
ich dachte das geht über die uiview? mit der eigenschaft documents oder so ähnlich hat man alle gerade ausgewählten doks. aber wie komme ich zur uiview?

zur erklärung: ich habe eine Ansicht, aus der heraus die Nutzer über eine Aktion ein bestimmtes Feld anpassen können, z.B. um einen Status oder so ähnlich zu ändern.

@rob green: bekomme ich damit nicht nur die ungelesenen?

Axel:
Hi,

mit der Methode UnprocessedDocuments aus der NotesDatabase-Klasse bekommst du alle markierten Dokumente in einer Ansicht.

Axel

MadMetzger:
sorry war mein fehler, ihr habt recht. hatte eine kategorisierte zeile ausgewählt...
klappt so...

Navigation

[0] Themen-Index

[#] Nächste Seite

Zur normalen Ansicht wechseln