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.
*This post is locked for comments