+ Start a Discussion
tyshocktyshock 

QueryResult.save() and general DynaBean save() questions

I was reading Dave's 3.3 beta blog entry, and he mentions the QueryResult.save() method.  However, this method doesn't yet exist in the 3.3 code.  Is this a future enhancement?
 
Also, from the docs i read, it says only a DynaBeans changed props should be sent during a save() call.  However, the save() call appears to always send all set properties for an update.
 
For the time being i'm going to assign onChange events to my editable bean props in order to flag dirty beans.
 
FYI:
 
This *may* be related to the following bit of unreachable code in Dynabean.beanToSObject (elseif block can't be reached......may be intentional since it's still beta):
 
Code:
if (filter != undefined) {
 if (filter == "forupdate") {
  addField = (fldDef.updateable  == true || fldDef.name.toLowerCase() == "id");
 } else if (filter == "forcreate") {
  addField = (fldDef.createable == true);
  if (prop.element != undefined) {
   addField = addField && (prop.dirty == true);
  }
  //addField = (addField && (prop.element != undefined && prop.dirty == true))
 } else if (filter == "forupdate") {
  addField = (fldDef.updateable  == true || fldDef.name.toLowerCase() == "id");
  addField = (addField && fldDef.createable == true);
  addField = (addField && (prop.element != undefined && prop.dirty == true))
 }
}

 
tyshocktyshock
DevAngel,
 
On line 3823 of the ajax client scripts, there is a typo......  'onChanage':
 
 
Sforce.Property.prototype.setOnChange = function(onchangeFunction) { this.onChanage = onchangeFunction; }; 
 
 
 
 
DevAngelDevAngel
Right, my mistake.  There is no save on queryResult, only on Dynabean.

Grab that toSObject code and put it in your scontrol file to override it.  Try taking the first if (filter == "forupdate") out to test the sparse updating.
DevAngelDevAngel
Thanks.  It's fixed in the next rel.