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
jayaram reddyjayaram reddy 

hide the start and end date fields in custom controller using user custom checkbox field

Hi,
I have created one checkbox in user fields,
which user has checkbox is true that user not see the custom object of start and end date fields,
which user has checkbox is false that user see that those fields.

i have tryed below code but this code is not working,
vf page:
<apex:outputField value="{!objAssessment.Audit_Start_Date__c}" rendered="{!usertrue_startDA_h}"> ---- avviewassement (page-830)
 
 Apex controller:

Public Boolean usertrue_startDA_h{Get;set;}
public List<user> userdata {get;set;}

  Userdata = new List<User>();
       Userdata=[select id,High_risk_country__c,Name from User where High_risk_country__c=:true]; 
         usertrue_startDA_h =false; 
         IF(Userdata[0].High_risk_country__c == false){
          usertrue_startDA_h =true;
          }        
Please help on this issue,

Thanks & Regards
jayarami reddy




 
Balayesu ChilakalapudiBalayesu Chilakalapudi
remove colon(:) in your query and try like
Userdata=[select id,High_risk_country__c,Name from User where High_risk_country__c=false]; 
 
jayaram reddyjayaram reddy
I have tryed remove colon(:) but its not working
Balayesu ChilakalapudiBalayesu Chilakalapudi
check field level permission for the field Audit_Start_Date__c, make it as visible.
jayaram reddyjayaram reddy
Hi Balayesu,

I have checked Field level permission visble  there for this field Audit_Start_Date__c.