It is common practice in Microsoft Dynamics 365 to use Business Rules to show and hide fields on a form. But, with that addition of multi-select option sets, you can't do this. So the next logical step is to use JavaScript. There is just one small problem, there is no setVisible() function for multi-selection option sets. Here are the controls we do have access too, as of this post:
So, how can we dynamically show / hide multi select option sets? The easiest way is to use a section. Place a new section on you form. Then you will need to use JavaScript to get the tab and section by name. Once you have that, you can dynamically show / hide the section to make the multi-selection option set show and hide. Here is an example of the JavaScript:
So, how can we dynamically show / hide multi select option sets? The easiest way is to use a section. Place a new section on you form. Then you will need to use JavaScript to get the tab and section by name. Once you have that, you can dynamically show / hide the section to make the multi-selection option set show and hide. Here is an example of the JavaScript:
function ShowHide(executionContext)
{
//Create the form context
var formContext = executionContext.getFormContext();
var contactStatus = formContext.getAttribute("Field Name").getValue();
var tabObj = formContext.ui.tabs.get("Tab Name");
var sectionObj = tabObj.sections.get("Section Name");
if (contactStatus === 1)
{
sectionObj.setVisible(true);
formContext.getAttribute("fieldName").setRequiredLevel("required");
}
}
Nice idea,keep sharing your ideas with us.i hope this information's will be helpful for the new learners.
ReplyDeleteSoftware Testing Training in Chennai
software testing course in chennai
JAVA Training in Chennai
Python Training in Chennai
Big data training in chennai
Selenium Training in Chennai
Software Testing Training in Chennai
Software testing training in OMR
Thank you for your post, I look for such article along time, today i find it finally. this post give me lots of advise it is very useful for me.
ReplyDeleteAWS Training in Chennai
Good blog with necessary information only..!
ReplyDeleteTesting Courses in Chennai
Software Testing Institute in Bangalore
Software Testing Course