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
reshmareshma 

How can I update selected record from flex in salesforce

Hi,
 
I want to update a particular record with calculated value in flex.
Its like this  where k1 is the text field in which i enter a value which must be added to the present value in salesforce and get
updated.So I am able to get the value from salesforce and text field and add them but unable to update the particular record.
Ao can anyon helip me out.
Thanks in advance
 

apex.query("Select GasType__c,Kgs__c,Va__c,Np__c,Size_mm__c From InventoryReport__c where year__c=2006", new AsyncResponder( function(yr:QueryResult):void {

if (yr.size > 0) {

kgsList1 = yr.records;

}},handleFault));

var i:int;

var kg2:int=new int();

// InventoryReport__c ic=new InventoryReport__c();

for (i = 0; i <kgsList1.length; i++) {

if(kgsList1.getItemAt(i,0).GasType__c=="C2F6"){

kg2=new int(k1.text);

kgsum=kgsList1.getItemAt(i,0).Kgs__c+kg2;

Alert.show("kgsum"+kgsum);

}

 

 

reshmareshma
i found the way to do this we have to use apex.upsert object
where InventoryReport__c is a salesforce custom object

Id,Np__c are fields and according to id we are updating the record

sobject = new SObject("InventoryReport__c");

sobject.Id = kgsList1.getItemAt(i,0).Id;

sobject.Np__c=nps;

apex.upsert("Id",[sobject], new AsyncResponder( function (result:Object):void{ }, handleFault));

 

Wipro Technologies