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
Project newProject new 

checkbox enabled

Hi 

In standard page layout one custom button Created ,whenever click on the button the corresponding all records checkbox enabled how can i achive this plz give me sample code.

Thanks
Project
 
Vinoth Vijaya BaskerVinoth Vijaya Basker
Hi, 

Please find the below Sample code, 
 
{!REQUIRESCRIPT("/soap/ajax/32.0/connection.js")}
var account = new sforce.SObject("Account");
account.id = "{!Account.Id}";
account.CheckeboxCustom__c = true;
result = sforce.connection.update([account]);
window.location.reload();

Paste the above code in Custom button which executes Javascript. 

This code updates the Custom Checkbox field of Account record. 


Thanks,
Vinoth