Hi,
I have coded a validation agent which is called from a simple button on the webpage. Its purpose is to loop through the existing documents in a view and prompt if there is a document with the same ID. Here is the code :
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim viewdoc As NotesDocument
Dim UsedID As String
Dim coll As NotesDocumentCollection
Dim docAction As NotesDocument
Dim view As NotesView
Dim strPath As String
Dim strURL As String
Dim docMatrix As NotesDocument
Set db = session.CurrentDatabase
Set doc = session.DocumentContext
Set view = db.GetView("luIDs")
Set docMatrix = db.GetDocumentByUNID(doc.ParentDocumentUNID)
Set viewdoc = view.GetFirstDocument
Do Until viewdoc Is Nothing
If viewdoc.NameID = doc.NameID Then
'Do Nothing for the Moment
Exit Sub
End If
Set viewdoc = view.GetNextDocument(viewdoc)
Loop
Call doc.Save(True, False)
strPath = ReplaceSubstring(db.FilePath, "\", "/")
strURL = "/" + strPath + "/Matrices/" + Trim$(docMatrix.UniversalID) +"?OpenDocument"
Print "[" + strURL + "]"
End Sub
When i call it all it does is refresh the current page and doesn’t save or load the specified webpage.
Thanks for any help.
F1H