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
Alex Valavanis 10Alex Valavanis 10 

Can we hide field based on another?

Hello,

Is possible to hide a lookup field if another field is flagged?

We have 2 fields

Fund (Lookup field)
Flag (checkbox)

Scenario is that if field "Flag" is ticked then Fund needs to be hidden. Can this be done within a page layout ? If not can it be done in a component?
ShirishaShirisha (Salesforce Developers) 
Hi Alex,

Greetings!

Currently this is not possible in page layout. Salesforce trying to possible this feature via lightning App builder.
Here is the Idea you can vote for this.
https://success.salesforce.com/ideaView?id=08730000000BroxAAC

However,you can achieve this using the visualforce page as suggested here.

https://salesforce.stackexchange.com/questions/224328/visualforce-display-and-hide-fields

Please mark it as best answer if it helps you to fix the issue.

Thank you!

Regards,
Shirisha Pathuri
Alex Valavanis 10Alex Valavanis 10
1. I was thinking of creating another record type and then a process builder/workflow which would switch the record type of the field "Fund" when the field "Flag" is ticked? 

2. What about dynamic forms? Don't they change the visibility of a field?

3. Validation rules?