Answered by:
Hide a tab on form load

Question
-
on our form I have a tab called tab_FM
The form also has an option set called new_software.
What i want to do is when the form is loaded, if the new_software text = "NoFM" (value 100000002) then shown tab_FM but hide it is new_software is any other value
thank you in advance
Dont ask me .. i dont know
Monday, August 12, 2013 10:00 AM
Answers
-
function showHide(){
if (Xrm.Page.getAttribute("new_software").getValue() == 100000002) {
Xrm.Page.ui.tabs.get("tab_FM").setVisible(true);
}
else {
Xrm.Page.ui.tabs.get("tab_FM").setVisible(false);
}
}Regards Faisal
- Marked as answer by Pete Newman Monday, August 12, 2013 11:20 AM
Monday, August 12, 2013 10:31 AM -
function showHideTab(){
if (Xrm.Page.getAttribute("new_software").getSelectedOption() != null && Xrm.Page.getAttribute("new_software").getSelectedOption().text == "NoFM") {
Xrm.Page.ui.tabs.get(tabIndex).SetVisible(true);
}
else {
Xrm.Page.ui.tabs.get(tabIndex).SetVisible(false);
}}
In Xrm.Page.ui.tabs.get(tabIndex), you should provide the tabindex.
Hope this helps!
Kalim Khan
- Edited by Kalim Khan Monday, August 12, 2013 10:39 AM
- Marked as answer by Pete Newman Monday, August 12, 2013 11:20 AM
Monday, August 12, 2013 10:38 AM
All replies
-
function showHide(){
if (Xrm.Page.getAttribute("new_software").getValue() == 100000002) {
Xrm.Page.ui.tabs.get("tab_FM").setVisible(true);
}
else {
Xrm.Page.ui.tabs.get("tab_FM").setVisible(false);
}
}Regards Faisal
- Marked as answer by Pete Newman Monday, August 12, 2013 11:20 AM
Monday, August 12, 2013 10:31 AM -
function showHideTab(){
if (Xrm.Page.getAttribute("new_software").getSelectedOption() != null && Xrm.Page.getAttribute("new_software").getSelectedOption().text == "NoFM") {
Xrm.Page.ui.tabs.get(tabIndex).SetVisible(true);
}
else {
Xrm.Page.ui.tabs.get(tabIndex).SetVisible(false);
}}
In Xrm.Page.ui.tabs.get(tabIndex), you should provide the tabindex.
Hope this helps!
Kalim Khan
- Edited by Kalim Khan Monday, August 12, 2013 10:39 AM
- Marked as answer by Pete Newman Monday, August 12, 2013 11:20 AM
Monday, August 12, 2013 10:38 AM