Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

javascript disable a section

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

hey guys,

trying to disable field onChange event by this code :

Xrm.Page.ui.tabs.sections.getControl('tab_4_section_1).setDisabled(true);

doesn't work :(

and the same to this similar logic using Xrm.Page Object mdoel

another attempt code : 

 Xrm.Page.ui.tabs.get('tab_4').setDisabled(false);

for disable a tab and again not working as well..

suggestions ?

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: javascript disable a section

    thanks every body u lead me to the answer

  • ashlega Profile Picture
    ashlega 34,475 on at
    RE: javascript disable a section

    Hi,

      not sure what is it you are trying to do. you can't disable a section/tab - there is no setDisabled method there: https://msdn.microsoft.com/en-us/library/gg328489.aspx

      

  • Suggested answer
    M I Mostafa Profile Picture
    M I Mostafa 4,257 on at
    RE: javascript disable a section

    Hi Hasooon,

    Use this for Dynamics CRM 2016:

    Xrm.Page.getControl("SectionName")

    Or get the name of an attribute in the section and then get its parent which is the section:

    Xrm.Page.getControl("industrycode").getParent()

    //this returns the section where the attribute industrycode exist

    Source:

    msdn.microsoft.com/.../jj602964.aspx

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: javascript disable a section

    Hi Hasooon,

    Following links help to disable sections and tabs.

    1) community.dynamics.com/.../crm2011-disable-enable-fields-sections-tabs-and-the-whole-form

    2) stackoverflow.com/.../setdisable-for-all-fields-of-a-section-in-a-crm-form

    Thanks..

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans