Sep 2, 2011 1:43 PM
66 Posts

Re: Update multiple documents in view by key(s)

  • Category: Server Side JavaScript
  • Platform: All
  • Release: 8.5.2
  • Role: Developer
  • Tags:
  • Replies: 6
 Thanks for the help! I got it to work by using this:
 
var keys = new java.util.Vector();
keys.addElement("5314");
keys.addElement("8698");
 
                //Loop through documents and update with newValue
for ( var i=0; i<keys.length; i++ ){
var dcColl:NotesDocumentCollection = view.getAllDocumentsByKey(keys[i], true);
dcColl.stampAll("BackendField", newValue);
}
 
Now all I need is to populate the "keys" vector with an array of sub-master keys. The first column of the view is categorized by a "Master" key. I need to get all the "Sub-master" keys associated with the master key I pass in. Would the getColumnValue() method be best for this?
 
View: 
Master       Sub-master
1234
                   4321 
                   5678
 
Update: Just ended up using a DbLookup. Thanks for all the help.