What is the most efficient way to hide fields across tabs in the same form?
Business Rules Screen gets too complex as the number of fields increase.
Please help, thanks.
*This post is locked for comments
What is the most efficient way to hide fields across tabs in the same form?
Business Rules Screen gets too complex as the number of fields increase.
Please help, thanks.
*This post is locked for comments
Hi KashyapT,
It would be better to create js in case of multiple if conditions.
Xrm.Page.ui.tabs.get("tabName").sections.forEach(function (section, sectionIndex) {
section.controls.forEach(function (control, index) {
control.getAttribute().setVisible("true/false");
});
Please refer below url for reference:
community.dynamics.com/.../retrieve-all-of-the-field-names-in-a-tab
Hi Kashyap,
If you have too many conditions then you can use javascript, to hide the fields.
You can use javscript to hide fields
by tab, by section or by individual field itself
use true to show false to hide tab directly
var tab = Xrm.Page.ui.tabs.get("tabname");
tab.setVisible(false); // show/hide
//for show hide fields in a tab
tab.sections.forEach(function (section, sectionIndex) {
section.controls.forEach(function (control, controlIndex) {
try {
var attribute = control.getAttribute();
var attname = attribute.getName();
Xrm.Page.getAttribute(attname).setVisible(false);
} catch (e) {
}
});
});
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,269 Super User 2024 Season 2
Martin Dráb 230,198 Most Valuable Professional
nmaenpaa 101,156