How to Use a LotusScript Print Statement to Open Another Web Page in a WebQuerySave Agent
This is something I want to post out on my blog so I can find it when I need it... From the KnowledgeBase...
How to Use a LotusScript Print Statement to Open Another Web Page in a WebQuerySave Agent
Doc Number: 1089692
Problem
How can a WebQuerySave agent be programmed
to go to another URL after a document is submitted?
Content
A WebQuerySave event or $$QueryOpenAgent
field can be used to call a LotusScript agent that contains a Print statement
like the following as its last line of code:
Print "[http://www.site.com/dbname.nsf/viewname?openview]"
The syntax is Print "[ URL ]".
The URL can be relative to the server's Data directory or absolute.
The print command will not do anything
in a script called from a WebQueryOpen event or $$QueryOpenAgent field.
You can also execute a Print "[ URL
]" redirect from a button, hotspot, or URL by calling the agent
containing the Print statement in the following ways:
@URLOpen("/database/agentname?OpenAgent")
@Command([ToolsRunMacro]; "agentname")
JavaScript
window.location="/database/agentname?OpenAgent")



Comments
I desperately need help.
On the browser I need to access control documents, based on a particular field value. The user should be a member of a group defined in another database. If he is not then the document will not open for him.
This concept works fine on the client but am not able to make it work on the web. Am new to scripting browser applications. So what am doing is pasting the code that I used in the client application and please help me with the browser version.
Thank u in advance
Sub Queryopen(Source As Notesuidocument, Mode As Integer, Isnewdoc As Variant, Continue As Variant)
Dim doc As NotesDocument
Set doc = Source.Document
' On Error Goto lblErrs
If Left(doc.SegmentType(0), 12) = "Naval Vessel" Then
Dim s As New notessession
Const NotesMacro$ = "@Name([ABBREVIATE]; @UserName)"
l_username = Evaluate(NotesMacro$, doc)
Dim dlcdb As notesdatabase
Dim ccdb As New Notesdatabase("","")
Dim view As Notesview
Dim ccdoc As Notesdocument
Dim path As String
Dim key1 As String
Dim key2 As String
Dim TargetDb As String
Set dlcdb = s.CurrentDatabase
path = Left$(dlcdb.FilePath,Instr(1,dlcdb.FilePath,"\xl",2)-1)
TargetDb=path+"/db.nsf"
Opentest = ccdb.Open ( dlcdb.Server, TargetDb)
If Not Opentest Then
Print "The database could not be opened. "
Continue = False
Exit Sub
End If
key1 = "Access Group"
Set view = ccdb.GetView("Group")
Set ccdoc = view.GetdocumentbyKey(key1,True)
If ccdoc Is Nothing Then
Messagebox "The access group could not be found in the Database. ", MB_OK, "Document Locked."
Continue = False
Exit Sub
End If
Dim dc As Notesitem
Set dc = ccdoc.GetFirstItem("Group_Members")
Forall l_names In dc.Values
If l_names = l_username(0) Then
Continue = True
Exit Sub
End If
End Forall
Messagebox "This document contains technical data whose export is restricted"+Chr(10)+Chr(10)+"Please contact TQM Department if you are receiving the message in error.", MB_OK, "WARNING !!!!!"
Continue = False
Exit Sub
End If
End Sub
Posted by Kushi At 00:44:35 On 25/08/2005 | - Website - |
temp:= "dbname" + /+ "agentname";
@command([ToolsRunMacro]; temp);
Posted by Al At 07:30:40 On 25/10/2009 | - Website - |
Posted by Sebastien Brodeur At 12:32:19 On 23/07/2010 | - Website - |