Hi Everybody
I changed the Form.QueryClose and Agent to work in the server. So i post my code here to help
Sub Queryclose(Source As Notesuidocument, Continue As Variant)
REM @If(rwfHasChanged = "new status":"remove status";<br/>
REM @Command([ToolsRunMacro];"(RWF DOC QUERYCLOSE)");"")<br/>
Dim s As New NotesSession<br/>
Dim db As NotesDatabase<br/>
Dim doc As NotesDocument<br/>
Dim agent As NotesAgent<br/>
Dim hasChanged As String<br/>
<br/>
Set db = s.CurrentDatabase<br/>
Set doc = Source.Document<br/>
hasChanged = Lcase$(Trim(doc.rwfHasChanged(0)))<br/>
If (( hasChanged = "new status" ) Or (hasChanged = "remove status") )Then<br/>
Set agent = db.GetAgent("(RWF DOC QUERYCLOSE SERVER)")<br/>
Print "Form.QueryClose" + doc.NoteID<br/>
If agent.RunOnServer(doc.NoteID) = 0 Then<br/>
Messagebox "Agent ran",, "Success"<br/>
Else<br/>
Messagebox "Agent not run",, "Failure"<br/>
End If<br/>
End If <br/>
End Sub
==========================================================================
(RWF DOC QUERYCLOSE SERVER)
import lotus.domino.;
import java.util.;
public class JavaAgent extends AgentBase {
public void NotesMain() {<br/>
<br/>
try {<br/>
Session session = getSession();<br/>
AgentContext agentContext = session.getAgentContext();<br/>
<br/>
Agent agent = agentContext.getCurrentAgent();<br/>
Database db = agentContext.getCurrentDatabase();<br/>
Document doc = db.getDocumentByID(agent.getParameterDocID());<br/>
//System.out.println("NoteID:" + agent.getParameterDocID());<br/>
WorkflowDocument.processContextDoc(doc);<br/>
} catch(Exception e) {<br/>
e.printStackTrace();<br/>
}<br/>
}<br/>
}