I’ve created a xpage with save button (simple action).The Querysavedocument event start an agent who makes a replaceitemvalue on a field (Numero) of the new created document.
My question is :
How refresh data modified by agent ?
I’ve tried in afterpageload event :
getComponent(“Numero2”).setValue( document1.getItemValueString(“Numero”));
document1.getItemValueString(“Numero”);
dont take the backend document .
Thanks
Subject: Solved
xpage querysavedocument :
var a:NotesAgent = database.getAgent(“SauveCorrespondantPrincipal”);
var doc:NotesDocument = document1.getDocument();
var noteId:String = doc.getNoteID();
a.runOnServer(noteId);
agent :
Dim s As New NotesSession
Dim agent As NotesAgent
Set agent = s.CurrentAgent
noteId$ = agent.ParameterDocID
Dim doc As notesdocument
Set doc = s.CurrentDatabase.GetDocumentByID(noteId$)
Call doc.ReplaceItemValue(“Numero”,“hello”)
Call doc.Save(True, False)
Save button :
onclick event:
document1.save();
var url=view.getPageName()+“?action=editDocument&documentId=”+document1.getNoteID();
context.redirectToPage(url);