Hi all! I am trying to write a script that will run OnChange for a field to clear all values in a specific tab. In this example, the Tab to be cleared is "Triage", and the field i'd like to have it execute on is "new_storereportedissue":
function clearTab() {
Xrm.Page.getAttribute("new_storereportedissue").addOnChange(clearTab)
var Triage = Xrm.Page.ui.tabs.get("Triage");
Triage.sections.forEach(function (section, sectionIndex) {
section.controls.forEach(function (control, controlIndex) {
switch (control.getAttribute().getAttributeType()) {
case "boolean":
//for checkbox control, uncheck it
control.getAttribute().setValue(null);
break;
}
});
});
}
I'd love any help. Thank you!
*This post is locked for comments
I have the same question (0)