Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 46379

visible true/false tabs

$
0
0

Hi, I need help with an specific requirement of my client, maybe someone would can help me.

My client wants a form with a dropdown where he can choose the quantity of floors a building has, and the tabs (where are the text fields with the information of each floor) are repeated for each floor. For example, if I choose "3" in the dropdown, the tab with the text field "kitchen" needs to apears 3 times in the form.

I know that it is posible to do with CRM configurations but the client wants it with javascript, my code is this:

function MostrarSecciones(){

var numnivel = window.parent.Xrm.Page.getAttribute("bln_nrodeniveles").getValue();

switch(numnivel)
{
case 1:
Xrm.Page.ui.tabs.get("DN1").setVisible(true);
case 2:
Xrm.Page.ui.tabs.get("DN1").setVisible(true);
Xrm.Page.ui.tabs.get("DN2").setVisible(true);
case 3:
Xrm.Page.ui.tabs.get("DN1").setVisible(true);
Xrm.Page.ui.tabs.get("DN2").setVisible(true);
Xrm.Page.ui.tabs.get("DN3").setVisible(true);
case 4:
Xrm.Page.ui.tabs.get("DN1").setVisible(true);
Xrm.Page.ui.tabs.get("DN2").setVisible(true);
Xrm.Page.ui.tabs.get("DN3").setVisible(true);
Xrm.Page.ui.tabs.get("DN4").setVisible(true);
case 5:
Xrm.Page.ui.tabs.get("DN1").setVisible(true);
Xrm.Page.ui.tabs.get("DN2").setVisible(true);
Xrm.Page.ui.tabs.get("DN3").setVisible(true);
Xrm.Page.ui.tabs.get("DN4").setVisible(true);
Xrm.Page.ui.tabs.get("DN5").setVisible(true);
case 6:
Xrm.Page.ui.tabs.get("DN1").setVisible(true);
Xrm.Page.ui.tabs.get("DN2").setVisible(true);
Xrm.Page.ui.tabs.get("DN3").setVisible(true);
Xrm.Page.ui.tabs.get("DN4").setVisible(true);
Xrm.Page.ui.tabs.get("DN5").setVisible(true);
Xrm.Page.ui.tabs.get("DN6").setVisible(true);
}
}

but it is not working and I don't know if the problem is some error in the code or that is not possible to do this in this way, somebody has the solution?

Note: I call my tabs "DN" and the number correspondt. 


Viewing all articles
Browse latest Browse all 46379

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>