Running an application on the web and creating a new document from an action button in a view.If there is no web querysave event coded, the document saves and opens the view specified in the $$Return field.
If I call an agent from WebQuerySave:
@Command([ToolsRunMacro];”(NewProjectSave)”
To be run On Event – Agent list selection
Agent properties ‘Run as Web User’ is ticked.
This is the test agent code:
Sub Initialize
Dim session As New notessession
Set db = session.CurrentDatabase
Dim opendoc As notesdocument
Set opendoc = session.DocumentContext
If opendoc.ReleaseName(0) = "" Then
opendoc.ReleaseName = "Invalid"
End If
End Sub
When the document is saved, the display is:
The page cannot be displayed
There is a problem with the page you are trying to reach etc. etc.
If your code is in the WebQuerySave, then it will ony run if you are using either a @command([filesave]) or document.submit(0) (js)Sub Initialize
Dim session As New notessession
Set db = session.CurrentDatabase
Dim opendoc As notesdocument
Set opendoc = session.DocumentContext
If opendoc.ReleaseName(0) = “” Then
opendoc.ReleaseName = “Invalid”
End If
End Sub
Assuming that there is a Save going on and this code is actually being called the code is still not doing anything except setting a field called ReleaseName to the value of “Invalid” and then losing it because it’s not saved there either.
Secondly, it is not creating any new docs either. Is this the extent of the code?