web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Hide/Show field based on entity view

(0) ShareShare
ReportReport
Posted on by

Hello,

Have two fields named isProduct(Yes/No) and Product Detail, both of them are located in Contact Form.

I create two Contact Views: Active Contact with Product and Active Contact without Product, filter is isProduct=Yes or isProduct=No respectively.

Opening the record in Active Contact without Product, I hope the Product Detail Field is hidden.


Are there any ways to achieve it? Using JavaScript or have to implement Plugin? Could you give me some sample code? Thanks.

I have the same question (0)
  • Suggested answer
    Leah Ju Profile Picture
    Microsoft Employee on at
    RE: Hide/Show field based on entity view

    Hi Partner,

    Hiding 'Product Detail' field on the View? or on the Form?

    2.You mentioned that you have created two contact views, so there is no need to hide the fields in the view, you just don't add the 'Product details' field to the 'Active contacts with products' view.

    1)Active Contact with Product

    pastedimage1680586833052v5.png

    pastedimage1680586853459v6.png

    2)Active Contact without Product

    pastedimage1680586906350v8.png

    pastedimage1680586878163v7.png

    2.If you don't want to see 'Product details' on the form when the 'isProduct' field equals 'No', you can use buisness rule to hide it easily.

    pastedimage1680586542985v4.png

    --Creating one business rule:

    pastedimage1680586442300v3.png

    --Test:

    pastedimage1680586360723v1.pngpastedimage1680586378973v2.png

    If you want to hide fields through javascript, you can refer to the following link:

    https://shafiuddinmicrosoftdynamics365crm.wordpress.com/2020/05/02/using-javascript-hide-and-show-a-field-in-microsoft-dynamics-365-crm/ 

  • ALAN365 Profile Picture
    on at
    RE: Hide/Show field based on entity view

    Hi Leah,

    Thank you so much for your detail explanation. Actually, is it possible, when I open the record listed in the "Active Contact without Product" View, the "Product Detail" column is hided automatically or doesn't install in the form? If yes, is this means different view open different record form?

    Thanks again.

  • Suggested answer
    Leah Ju Profile Picture
    Microsoft Employee on at
    RE: Hide/Show field based on entity view

    Hi Partner,

    You must add the "Product Detail" column on the forms firstly, then you can use business rule or js to hide/show it automatically.

    --Creating business rule

    pastedimage1680745271836v1.png

    Make the business rule scope is Entity, it can work on all forms,

  • Suggested answer
    CRMJetty Profile Picture
    3,512 on at
    RE: Hide/Show field based on entity view

    Hello ALL365,

    = > Yes we can do so.
    = > With the help of business rule we can hide particular fields based on view's filter.
    = > Refer this blog to hide/show fields based on some condition.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Sahan Hasitha Profile Picture

Sahan Hasitha 169

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 67 Super User 2025 Season 2

#3
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 65

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans