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
imrohitimrohit 

hi all i have a question

i am showing my records which is coming from metadata to visualforce page using apex reapeat also i used mode=inlineEdit in my pageblock to make my records editable on vf page now i add one more field in my metadata that is is readonly which is of type checkbox if some field has checkbox value to true i don't want that field's value to be editable 
 
what can i do for this please suggest something your help is highly appreciable
SandhyaSandhya (Salesforce Developers) 
Hi,

In your Apex  create method  as below
 
    public Boolean bool {get;set;}

public Boolean changeBool()
    {        
        if( if(checkboxfield__c))
        {
            bool = true;
        }
        else
        {
            bool = false; 
        } 
return bool;
    }
In visualforce
<apex:outputField value="{!checkboxfield__c}">
          <apex:inlineEditSupport disabled="{!changeBool}"/>
     </apex:outputField>

https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_inlineEditSupport.htm
 
Please mark it as solved if my reply was helpful, it will make it available
for others as a proper solution.

Best Regards,
​Sandhya