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)

Collapse Tab by Default Regardless of Field Visibility Business Rule

(0) ShareShare
ReportReport
Posted on by

Within my Opportunity form, I have tabs that contain conditional fields. These fields are only visible if a certain condition is met - so I have a business rule that toggles their visibility based on this condition.

I would like to collapse all but the main tab when an opportunity is loaded. Having these field level visibility rules prevents the "Expand this tab by default" option from working. I would like these tabs to be collapsed by default. 

Any ideas how I can implement this?

Thanks,

Jeff

*This post is locked for comments

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

    Hi Jeff, Thank you for reaching out. While the business rules are very useful they don't do absolutely everything we need, yet. I have solved this two ways. When it is just a few fields I have broken those fields into tabs and then toggle visibility of all the fields in that tab based on the condition. This hid the tab when there were no fields visible.

    If the form is big which I would expect the Opportunity form to have a lot going on, then I use JavaScript on the form. First if you have other JavaScript on the form you may want to check with the owner of that script to avoid conflicts. If you feel comfortable enough you can use the below script as a start for hiding a tab based on a condition. The key is you would have to do one or the other. CRM does not like it when JavaScript and Business Rules adjust the same fields. 

    Please verify if this gives you an answer. Let us know if you need more help. Have a wonderful day!

    -Tom

    // Set to go on form load and field change
    
    function HideTab(){
    
    	// Set a variable for the condition you are needing met, the example below is for looking up an option set value
    	var conditionMet = Xrm.Page.getAttribute("field_schema_name").getSelectedOption().value;
    
    	// Where 1 = the value of the option set with the condition
    	if(conditionMet == 1){
     
    	// TAB is the name (not the label) of the tab you want hidden
    	Xrm.Page.ui.tabs.get("TAB").setVisible(false); //Hide Tab
    
    	}                      
    }
    


     

  • Suggested answer
    Pradeep Gowda Profile Picture
    on at

    This Seems to be Product Defect , You would be able replicate this if you have business rule Functional on the tab.

    Issue is Replicated in the version :(8.2.2.128) (DB 8.2.2.135) and Even the lower version's i believe.

    However it is not getting replicated in 9.0

  • Suggested answer
    Pradeep Gowda Profile Picture
    on at

    This Seems to be Product Defect , You would be able replicate this if you have business rule Functional on the tab.

    Issue is Replicated in the version :(8.2.2.128) (DB 8.2.2.135) and Even the lower version's i believe.

    However it is not getting replicated in 9.0

  • Suggested answer
    Vipin J Profile Picture
    1,603 on at

    problem I had faced which was from business rules.

    Here is a blog post - [View:https://vjcity.blogspot.com/2019/05/deactivated-business-rule-running-in-ms.html:750:50]

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