Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

How to get specific attribute from a specific tab and section

(0) ShareShare
ReportReport
Posted on by 645

Hi, my situation is that I have a field twice on the same form and I need to get one of them, I thought about getting the section and then the tab and the attribute, how can I do that?

  • antc Profile Picture
    antc 2,909 on at
    RE: How to get specific attribute from a specific tab and section

    This works:

    formContext.ui.tabs.get(3).sections.get(0).controls.get(0).getAttribute("msdyn_instructions").setRequiredLevel("required")

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,325 Most Valuable Professional on at
    RE: How to get specific attribute from a specific tab and section

    Control doesn't have requirement level possibility. Attribute has. Try following:

    Xrm.Page.getAttribute("colour").setRequiredLevel("required");

  • sahara Profile Picture
    sahara 645 on at
    RE: How to get specific attribute from a specific tab and section

    it works great but now I have a new prob I need to set this control/attr as required and I fet errors:

    if(Xrm.Page.ui.tabs.get("tab1").sections.get("section").controls.get("colour").getVisible()) - works

    {

     Xrm.Page.ui.tabs.get("tab1").sections.get("section").controls.get("colour").setRequiredLevel("required"); - doesn't work - error

     Xrm.Page.ui.tabs.get("tab1").sections.get("section").controls.get("colour").getAttribute("colour").setRequiredLevel("required");- doesn't work - error

    }

    How do i do that?

  • Verified answer
    a33ik Profile Picture
    a33ik 84,325 Most Valuable Professional on at
    RE: How to get specific attribute from a specific tab and section

    Attribute doesn't have visibility. Attribute is all about the data.

    Control is about visible/hidden.

    Try following:

    Xrm.Page.ui.tabs.get("tab").sections.get("Vehicle").controls.get("colour")

    or

    Xrm.Page.ui.tabs.get("tab").sections.get("Vehicle").controls.get("colour1")

    because indexing is used when there are multiple controls for the same field - docs.microsoft.com/.../controls-collection

  • sahara Profile Picture
    sahara 645 on at
    RE: How to get specific attribute from a specific tab and section

    I tried this :

    Xrm.Page.ui.tabs.get("tab").sections.get("Vehicle").getAttribute("colour")

    I need to check if one of the "fields" is visiable

  • a33ik Profile Picture
    a33ik 84,325 Most Valuable Professional on at
    RE: How to get specific attribute from a specific tab and section

    Hello,

    Attribute is the same but it has 2 controls. What's your scenario?

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,430 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans