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 :
Microsoft Dynamics CRM (Archived)

Disable a section in dynamics 365 crm form

(0) ShareShare
ReportReport
Posted on by 185

Hi..I am using dynamics 365 crm online . Below code is not working when I am trying to disable a section onchange of a field.

(Note : There is a HTML webresource in the section.That webreource is a button) 

var ctrlName = Xrm.Page.ui.controls.get();

for (var i in ctrlName) {

var ctrl = ctrlName[i];

var ctrlSection = ctrl.getParent().getName();

if (ctrlSection == "tab_3_section_2") {

ctrl.setDisabled(true);

}
}

Can some one please help me on this ? Thanks in advance !!

*This post is locked for comments

I have the same question (0)
  • David Jennaway Profile Picture
    14,065 on at

    Disabling a section will disable fields within that section, but will not affect the any web resources (as it has no knowledge of the content of these web resources). If you want to disable the button in the web resource, you could use getObject on the web resource control to get the IFrame object, and you should then be able to navigate to the button via the document object of the IFrame.

    Or, you could create a separate web resource with a disabled button, and load that instead

  • Suggested answer
    gupta.ambar2009@gmail.com Profile Picture
    797 on at

    Hello ,

    Go through with this , might be helpful for you

    community.dynamics.com/.../crm2011-disable-enable-fields-sections-tabs-and-the-whole-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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans