You need to sign in to do that
Don't have an account?
custom button to update checkbox?
I'm trying to create a button on the object Opportunity Product, The button is a List Button and I want it to update the checkbox of the selected items.
{!REQUIRESCRIPT("/soap/ajax/37.0/connection.js")}
var opp = new sforce.SObject('OpportunityLineItem');
opp.id = "{!OpportunityLineItem.Id}";
opp.Use_Calculated_Price__c = 1;
result = sforce.connection.update([opp]);
location.reload(true);
It doesn't show any mistake, but only refreshes the opportunity page.
I tryed with diferent values like '1', true, True, TRUE.
Thanks.
{!REQUIRESCRIPT("/soap/ajax/37.0/connection.js")}
var opp = new sforce.SObject('OpportunityLineItem');
opp.id = "{!OpportunityLineItem.Id}";
opp.Use_Calculated_Price__c = 1;
result = sforce.connection.update([opp]);
location.reload(true);
It doesn't show any mistake, but only refreshes the opportunity page.
I tryed with diferent values like '1', true, True, TRUE.
Thanks.
The above code is not working as the code is only handling one record, therefore, it is not able to update multiple records selected.
Please use the below code, it will work fine:
Please let me know if this helps.
If yes, please mark the Question as Solved as a best practice, so that others can also benefit from the answer.
Thanks and Regards,
Anirudh Singh
All Answers
The above code is not working as the code is only handling one record, therefore, it is not able to update multiple records selected.
Please use the below code, it will work fine:
Please let me know if this helps.
If yes, please mark the Question as Solved as a best practice, so that others can also benefit from the answer.
Thanks and Regards,
Anirudh Singh
Anyway Thanks you! I forgot to update this question :)