+ Start a Discussion

Custom Button and Checkbox

Is it possible to create a custom button on the Contact page that checks a checkbox (a custom field)?  I'm having trouble writing some javascript that would accomplish that.  Any help?

Shashikant SharmaShashikant Sharma

You can create a Detail Page Button on contact object and set it's behaviour as Execute Javascript

In Contact source you can write your js , i have alerted this 





And please add this detail button to layout also. update your page layout.

For checkbox field it will show 1 and 0 for true and false

Rahul SharmaRahul Sharma

Put this javascript code :

It will work in your case.


var a = new sforce.SObject("Contact");
a.Id = "{!Contact.Id}";
a.UpdateContact_Type__c = true;
// In my case Boolean field is UpdateContact_Type__c Change it as yours

Let me know if you still face any issues. :)




that was exactly what i had issues with also 


But thank you for ur tip as i was able to manipulate urs to make mine work