title: Setting a field on a form - xPages
body: <p>I am a newbie to xPages, not to Notes though.  I have a type ahead field that works and it brings in the value needed.  After that, I want to lookup information for the key they just entered and fill in fields on the form for that document.  In the onChange event, I have the following code.  I get the record but the setValue isn't working or at least it's not displaying on the xPage.  Can someone help?</p>
  
  <pre><code>var path = database.getFilePath().split(database.getFileName())[0];
  var lookupDB:NotesDatabase = session.getDatabase(database.getServer(), "db2.nsf");
   var vLookup:NotesView = lookupDB.getView("viewname");
  var compID = getComponent("typeaheadfield").getValue()
  var custDoc:NotesDocument = vLookup.getDocumentByKey(compID);
  document1.setValue("fieldname", custDoc.getItemValue("custdocfieldname"));
  </code></pre>