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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Show/Hide field on form

(0) ShareShare
ReportReport
Posted on by 5

I'm writing what should be a simple JavaScript web resource to show/hide several fields on a form based on a few conditions, but I'm getting an error that doesn't make any sense. I've done this exact same thing a few times before, using formContext.getAttribute(<field name>).setVisilbe(<true/false>); but now I am getting an error saying that this function doesn't exist. I am able to hide tabs and sections of the form, but not individual fields. Is this a bug or was there a recent change to this function? We're supposed to have this working for our customers tomorrow. Any help would be greatly appreciated! 

setVisible-error.PNG

I have the same question (0)
  • Suggested answer
    meelamri Profile Picture
    13,218 User Group Leader on at

    Hi, 

    Try this: 

    formContext.getControl(arg).setVisible(bool);

    And remember to pass the executionContext to your function

  • Suggested answer
    Satish Tiwari - CRM Profile Picture
    Microsoft Employee on at

    Hello Allyh,

    You can also use Business rules to show / hide fields based on certain actions. You can find more details about Business rules here - docs.microsoft.com/.../create-business-rules-recommendations-apply-logic-form

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 212 Super User 2026 Season 1

#2
CU11031447-0 Profile Picture

CU11031447-0 100

#3
NeerajPawar Profile Picture

NeerajPawar 68

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans