function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
fullvaluefullvalue 

Flex Toolkit

So in the Ajax toolkit I can do as follows:

Code:
     var project = new sforce.SObject("Project");
     project.set("Id", id);
     project.set(field, newval);
var callback = {onSuccess : success, onFailure : log}
var result = sforce.connection.update([project],callback);

 The .set allowed me to use a variable as the field name.  How can I do this in the Flex toolkit? 


Thanks

Message Edited by fullvalue on 09-19-2007 06:00 PM

fullvaluefullvalue
Anyone have any insight?  Please!

Thanks
Ron HessRon Hess
    var acc:SObject = new SObject('Account');
        acc.Name = 'new account name';
fullvaluefullvalue
Thanks for the response Ron but here is what I'm trying to get at.

I want to use one handle for mutiple objects.

On the change event for a number of objects I want to run an update query. 

Thanks!

Example:

Code:
<mx:TextInput id="Site_Zip_Code__c" change="upd_query(event)" />

private function upd_query(event:Event):void
{
upd.Id = projectId;
// here is where I used the .set in the Ajax toolkit
upd.event.currentTarget.id = currentTarget.text
// clearly event.currentTarget.id will not work but
//the point is I want to use it for the field name
apex.update([upd], new AsyncResponder(updResult, handleFault))
}




 

Message Edited by fullvalue on 09-21-2007 12:41 PM

Message Edited by fullvalue on 09-21-2007 12:42 PM

Ron HessRon Hess
i guess

upd[currentTarget.text]  = somethingvalue

upd should be a dynamic object




fullvaluefullvalue
That worked....Thanks.


upd[event.currentTarget.id] = currentTarget.text