Skip to main content
Is it possible to display a custom field, based upon the value of another field? For example, if "Opportunity Type" = "X" - then display "Field 1". If Opportunity Type" = "Y" then "Field 1" is not displayed.
9 answers
  1. Mar 4, 2019, 4:42 PM
    Yes & No.

     

    Using the standard, out-of-the-box Detail Page Layouts - No.  You can't.

     

    But here are some ways to work this magic:

     

    - You can create a Visualforce page that will do this, and then embed that Visualforce page in your Page Layout (this will work for both Classic & Lightning)

     

    This post has a couple of links that include examples of how to do this https://developer.salesforce.com/forums/?id=9060G000000XbqFQAS

     

    - You can create a Lightning Web Component to do this (would only work in lightning, but similar idea to the Visualforce page above -- sorry, I don't have examples for this one).

     

    - In Lightning, you also have the option to add Conditions to parts of your Lightning Page.  So you could actually create a Visualforce Page or Lightning Web Component that simply displays your 'special' fields... and then in the Lightning Page Layout Editor, you could drop in your VF Page or Component and then add a condition right there that says 'only show this thing if certain fields have certain values'.  This would be the easiest way to add the condition, and it makes writting your VF Page/Component much easier.

     

    Here is the link to how to create those Dynamic Lightning Pages: https://help.salesforce.com/articleView?id=lightning_page_components_visibility.htm&type=5

     

    I hope this gives you some ideas to work with!
0/9000