• Home
  • About
    • Leadership
    • Partners
    • Blogroll
  • Force-Squared Blog
    • Tips and Tricks
    • Configuration
    • Development
  • Support
    • Knowledge Base
    • Submit a Case
  • Is It Dreamforce Yet?

X-Squared On Demand

Salesforce solution development

  • Home
  • About
    • Leadership
    • Partners
    • Blogroll
  • Force-Squared Blog
    • Tips and Tricks
    • Configuration
    • Development
  • Support
    • Knowledge Base
    • Submit a Case
  • Is It Dreamforce Yet?
  • Tips and Tricks
  • Configuration
  • Development
You are here: Home / Salesforce CRM / Development / Apex / Checkbox Formula Field in Visualforce

Checkbox Formula Field in Visualforce

May 21, 2009 by David Schach Leave a Comment

In keeping with the theme of checkboxes and formulas, we provide an easy way to create a checkbox formula field using Visualforce: the checkbox tag with the disabled attribute:

First, the Apex controller method:

public boolean checkformula(){
boolean b = [insert formula here];
return b;
}

And the visualforce code:

<apex:inputCheckbox disabled="true" value="{!checkformula}"/>

That's it! Of course, there are many ways to set up the Apex method, but the important piece is the Visualforce markup. By using a tag usually associated with an edit page but making it disabled, the checkbox becomes an output field.

Related

Filed Under: Apex, Development, Salesforce, Visualforce Tagged With: Apex, Visualforce

← Pulling Code Out of Triggers Eclipse as a Password Manager →

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Find Us Online

  • Twitter
  • Facebook
  • LinkedIn
  • RSS

Subscribe

RSS Feed Comments

Subscribe via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 5,089 other subscribers

Copyright © 2008–2022 X-Squared On Demand · Genesis Framework by StudioPress · WordPress · Log in