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
bathybathy 

custom visualforce page to display detail page of a custom object record

Hi Guys,
I am developing a cusotm VF page to display details of a cusotm object record with inline editing. I need to change the value of a field based on the value change of another field. I am shariing my code. Please let me know if this can be done with a detail page.
<apex:OutPutPanel >   
     <apex:OutputLabel style="font-weight:500" value="Are you a smoker?     " />  
     <apex:ActionRegion >
       <apex:InputField value="{!Fact_Find__c.Are_You_a_Smoker__c}" > <apex:ActionSupport event="Onchange" rerender="if1" /> </apex:InputField>
     </apex:ActionRegion>
   </apex:OutputPanel> 
     
     
   <apex:outputpanel id="if1">   
     <apex:Outputlabel value="If yes, how many per day?" rendered="{!IF(Fact_Find__c.Are_You_a_Smoker__c ='Yes',true,false )}" />    
      <apex:OutputField value="{!Fact_Find__c.If_Yes_How_many_per_day__c}"  rendered="{!IF(Fact_Find__c.Are_You_a_Smoker__c ='Yes',true,false )}"/>     
   </apex:OutputPanel>
Not sure if this is right method to achieve my requirement. Any help is greatly apreciated.

Thank,
Bathy.
 
NagaNaga (Salesforce Developers) 
Hi Bathy,

Please see the sample code below, it might be similar to what you want.

User-added imagePlease follow the below link and let me know if it helps

http://stackoverflow.com/questions/13225541/display-custom-object-and-fields-with-visualforce

Best Regards
Naga Kiran