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
Arunkumar KathirArunkumar Kathir 

Hide a field based on value of another field



In my application I have an object namely "Position".


In Position object I have a field called Description. This is a text are field.


Hereafter I want this description field as Checkbox.


If I change the datatype of Description field to Checkbox, data in this field for already created records will be lost.


So I have created a new field as Description1 using Checkbox datatype.


Now my requirement is,


For existing Position records - display the Description field if it has any value and hide Description1. If it doesn't have any value hide Descrption and show Description1. 


For new Position records - only display the Description1 field.


Position page is standard page not a visualforce page. So I want to do this without using visualforce page.








I think it won't be done without using Visualforce Page. If you want to do any customization we should create a visualforce page.

Nice Requirement, If you find any solution please update.


I don't think it is possible to hide the fields...Instead you can display both the fields and using validation rules you can restrict the users to populate the appropriate field...


If you use "record types" and set all the old records to one type, and the new ones to another, you can create page layouts that show the correct fields for each record type.  But the downside is now you have two record types when creating "new" records from which to pick.