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
SalesforceLearnerSalesforceLearner 

Dont want to render page block if particular condition is satisfied

I tried using below code but it is not working. If i use it in Vf page it is working.

Page


<apex:pageBlockSection columns="1" rendered="{!NOT(isString=true)}"> <apex:pageBlockSectionItem labelStyle="text-align: left; padding-bottom: 15px"> <apex:outputLabel value="{!$Label.Revenue}" for="tabIndex21" /> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem labelStyle="text-align: left; padding-bottom: 15px"> <apex:inputField id="tabIndex21" value="{!MPE.Revenue__C}" required="true"/> </apex:pageBlockSectionItem>
<apex:pageBlockSection >

Apex:

public void emeaChanges()
 {
          isString = false;
          
          if(EmpwrApp.Region_Theater__c.Contains('WEST'))
          {
          if((EmpwrApp.Technology_Segment_Interest__c.Contains('X'))||(EmpwrApp.Technology_Segment_Interest__c.Contains('Y'))||(EmpwrApp.Technology_Segment_Interest__c.Contains('Z')))
          {
                isString = true;
          
          }
         
          }
          else
          {
          isString = false;
          }
James LoghryJames Loghry
= is an assignment operator, while == is a comparison operator.  You're using the former in the rendered attribute.  

Otherwise, you could simply specifiy rendered="{!NOT(isString)}" and it should work just fine.

Also, keep in mind that you want to render a parent element of the pageBlockSection and not the pageblocksection itself.