I am saving a document on web but this document don’t save it
The source agent is:
Dim ns As New notessession
Dim doc As NotesDocument
Set doc=ns.documentcontext
res= doc.save(True,False)
the formula form is:
@Command([ToolsRunMacro];“prueba”)
some solutions for this?
Subject: save document on web
Where is the code which calls the agent stored? Is the user clicking a button to submit the document?
Subject: RE: save document on web
the code which calls the agent when user cliking the button is
@Command([ToolsRunMacro];“saveDocument”)
And code agent is named ‘saveDocument’
Dim ns As New notessession
Dim doc As NotesDocument
Set doc=ns.documentcontext
Dim res As Integer
res = doc.Save (True,False)
Subject: RE: save document on web
Sorry, I didn’t look at the code very closely before. You have to all the doc.save function, e.g.
Call doc.save(true, false)
Subject: RE: save document on web
with this code, the agent neither save the current document
Sub Initialize
Dim ns As New notessession
Dim doc As NotesDocument
Set doc=ns.documentcontext
Call doc.Save (True,False)
End Sub
Is the problem in agent properties?
Subject: RE: save document on web
why call an agent ? just use @command([FileSave])
Subject: RE: save document on web
I agree. I have a similar situation. I have a web form that is saved and then an agent is run based on the contents of the form that was just saved. In the save and exit button I have this code:
@Command([FileSave];
@Command([FileCloseWindow]);
@Command([ToolsRunMacro];" your agent name here")
Works perfectly!!!
Good luck
Subject: save document on web - Wrong Doc Context
When you call this agent from the web, without using WeqQuerySave or $$QuerySaveAgent field, the document context is not the document being edited, but actually the request from the web browser to call the agent.
Perhaps you are creating unknown document types when you execute the save command, but you are not saving the document you want.