I’m trying to use XPages without explicitly binding the fields to the underlying form datasource (instead, I’m using scoped variables.) In the onClick event of my “Save” button, I have the following code to create a document:
var docObj:NotesDocument = null;
docObj = database.createDocument();
docObj.replaceItemValue(“itemName”, itemName.toUpperCase());
docObj.replaceItemValue(“itemDescription”, requestScope.itemDescriptionVar);
docObj.replaceItemValue(“submittedBy”, getComponent(“submittedBy”).getValue());
docObj.replaceItemValue(“submittedOn”, getComponent(“submittedOn”).getValue());
docObj.replaceItemValue(“contactName”, requestScope.contactName);
docObj.replaceItemValue(“form”, “fMain”);
docObj.save();
It works fine, but how can I extend it to also include the file that the user selected from the File Upload control and save it like I did above with the other fields?