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
EmsEms 

Simple Syntax question!

I have a component that I want to render based on the opposite of a checkbox setting...

 

THis works fine:

<apex:pageblock rendered="{!pitem.Sold__c}">

 

But I can't figure out how to NOT (or !) pitem.Sold__c

 

This doesn't work (nor do many different combinations of quotes and !s that I've tried.

<apex:pageblock rendered=NOT(pitem.Description)>

 

 

Anybody have a solution to this simple problem???

Best Answer chosen by Admin (Salesforce Developers) 
jwetzlerjwetzler
{! !pitem.Sold__c} or {!NOT(pitem.Sold__c)}

the {!} signifies that you're using an expression that Visualforce needs to parse. Then either NOT() or ! is acceptable syntax.

All Answers

jwetzlerjwetzler
{! !pitem.Sold__c} or {!NOT(pitem.Sold__c)}

the {!} signifies that you're using an expression that Visualforce needs to parse. Then either NOT() or ! is acceptable syntax.
This was selected as the best answer
EmsEms
Thanks so much - Interesting that the second ! is the one that signifies the NOT, this clarifies a few things for me!