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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Hide Tab Using Business Rule`

(0) ShareShare
ReportReport
Posted on by 1,788

Is this possible? If not, how can I best achive this? I require a tab to be hidden when a particular option set value is selected...

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    ansrikanth Profile Picture
    3,115 on at

    I'm not sure about business rules, But with Javascript it should be stright forward...

    <<TAB>>.setVisible(true/false) should do the trick directly.

    Please refer msdn.microsoft.com/.../gg328067.aspx for further more details.

    Happy coding..

    -Srikanth

  • Suggested answer
    Abed Haniyah Profile Picture
    4,287 on at

    Dear MDS,

    If you hide all of the fields in a tab by business rules, it will hide the tab as well.

    Regards,

    Abed.

  • MDS Profile Picture
    1,788 on at

    Thanks. The tab I want to hide only contains a chart from a related entity, so I'm unable to choose it in the "hide field" element of the business rule....

  • Verified answer
    Abed Haniyah Profile Picture
    4,287 on at

    In your cases you can hide it only by using java script, please take a look to : msdn.microsoft.com/.../gg328067.aspx

    and

    community.dynamics.com/.../117395.aspx

  • Suggested answer
    Aileen Gusni Profile Picture
    44,524 on at

    MDS,

    In your case you need javascript, can't use Business Rule.

    Thanks.

  • Suggested answer
    Mahendar Pal Profile Picture
    45,095 on at

    You can simply use

    Xrm.Page.ui.tabs.get("TABName").setVisible(true); //to show

    Xrm.Page.ui.tabs.get("TABName").setVisible(false); //to hide

  • MDS Profile Picture
    1,788 on at

    Thanks all. My javascript is bit/lot rusty.

    I have a option set - IsSchool - that should dictate whether tab_6 is visible or not. If IsSchool value equals Yes, then tab_6 should be hidden and vice versa.

    Here is my code (that's not working)....

    function IsSchool()

    {

    var IsSchool = XRM.Page.getAttribute("new_IsSchool").getValue();

    if (IsSchool == True)

    Xrm.Page.ui.tabs.get("tab_6").setVisible(false);

    }

    I need the tab behaviour to change when the option set is selected, so I presume it needs to be OnChange....

    Thanks.

  • Abed Haniyah Profile Picture
    4,287 on at

    Is IsSchool field tow option or option set?

  • Suggested answer
    Abed Haniyah Profile Picture
    4,287 on at

    If its an option set type then you must get the value of item "YES" from IsSchool field properties screen, then make a condition on the value not on "true" or "false".

  • MDS Profile Picture
    1,788 on at

    It's a two option set (basic yes/no).

    I've changed as below:

    function IsSchoolPartner()

    { var IsSchool = XRM.Page.getAttribute("new_IsSchool").getValue();

    if (IsSchool == Yes)

    Xrm.Page.ui.tabs.get("tab_6").setVisible(false); }

    The error I'm getting when changing the IsSchool option is "XRM is undefined"

    Any help greatly appreciated..

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans