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
Anthony GarandAnthony Garand 

adding custom check box to contact detail page

Hello Salesforce Developers!

I am trying to add a custom checkbox to the contact page,
This checkbox will say "Inactive" with a check box next to it on the detail page.


User-added image'

Much like the Email Opt Out check box. 

Any help will be greatly appreciated! Thank you for your time.

Tony Garand.
LBKLBK
Hi Tony,

When you said Contact page, did you mean a Visualforce page?

Anyways, you need to add the custom field to Contact object first.

For example, if you add Email_Opt_Out__c to your Contact object, you can add it to Contact Page Layout just by editing the required Layout (unless you have added it to the Layout while creating the field itself).

To add it to the VF page, you need the following code.
 
<apex:inputfield value = {contact.Email_Opt_Out__c} />
Let me know if this helps.