You need to sign in to do that
Don't have an account?
iSfdc
for(var i =0;i<records2.length;i++)
var c= new sforce.SObject("OpportunityLineItem");
c.Id=records2[i].Id;
c.Amount_On_First_Year__c=amountyear;
c.Quantity_on__c=quantyear;
result2= sforce.connection.update([c]);
Update outside a for loop
Hi,
I am trying to update the Opportunity Line Items with two Custom field values. When one Opportunity has multiple Products, I need to update all the Products with the two Custom fields. I am updating inside a for loop , it works fine. But I am not able to update all the line Items in a Single go outside the for loop, so that one time update would happen.
Snippet:
for(var i =0;i<records2.length;i++)
var c= new sforce.SObject("OpportunityLineItem");
c.Id=records2[i].Id;
c.Amount_On_First_Year__c=amountyear;
c.Quantity_on__c=quantyear;
result2= sforce.connection.update([c]);
if (result2[0].getBoolean("success")) {
count++;
}
count++;
}
}
Is there anyway to Update all the Records outside the for loop, any pointers would help.
Gani
I think this is what you are looking to do:
It should at least get you pointed in the right direction,
-greg