I am trying to pre-populate some fields on an XPage (that creates a new doc) using an old LotusScript agent. My code on the XPage is:
<xp:dominoDocument var="document1"
formName="myForm">
<xp:this.postNewDocument><![CDATA[#{javascript:
var agent = database.getAgent("MyAgent");
document1.save();
agent.runOnServer(document1.getNoteID());
}]]></xp:this.postNewDocument>
</xp:dominoDocument>
<xp:inputText value="#{document1.fname}" id="fname"
styleClass="formInputText">
<xp:this.defaultValue><![CDATA[#{javascript:
document1.getItemValueString("fname");}]]></xp:this.defaultValue>
</xp:inputText>
The agent (for this example) is:
Dim agent As NotesAgent
Dim db As NotesDatabase
Sub Initialize
Dim rDoc As NotesDocument
Dim s As New NotesSession
Set db = s.CurrentDatabase
Set agent = s.CurrentAgent
Set rDoc = db.GetDocumentByID(agent.Parameterdocid)
rDoc.fname = "Barney"
rDoc.lname = "Rubble"
Call rDoc.Save(True, True)
End Sub
I know the agent is running (Agent log shows this and the fields are completed on the doc if I check the doc properties in Notes Client) however the field on the XPage is always blank? Is it possible to prepopulate from a LS agent? I added the document1.save() so I know I get a valid NoteID passed over (again which is the same - checked by logging) - any insight gratefully received...