Hi,
I know that it is possible to hide fields on forms based on certain value.
Is there possibility to show/hide dropdown values inside one field with business rules?
Thanks in advance
*This post is locked for comments
Hiding was the all drop down values that was according to the business rule on this I have some question regard this. I need to get answer so I wrote them all according to the grademiners so I can get all answer of the subjects I have in my mind.
Hi Davor,
It is not possible with business rule, but you can achieve this by using javscript code.
If you want to hide optionset on some other field let say fieldX, then write a javascript code on Onchange event of FieldX,
Please check this link for the code,
vasubabumscrm.blogspot.com.au/.../addremove-optionset-value-at-run-time.html
Hope this helps,
Best Regards,
Shahbaaz
Hi ,
You need to write simple javascript to add or remove options from optionset field as per your business logic.
Here is sample code-
function OnloadOptionSet() {
var optionSet = Xrm.Page.ui.controls.get("new_myoptionset");
var optionSetValues = optionSet.getAttribute().getOptions();
optionSet.clearOptions();
optionSetValues.forEach(function (element) {
if (element.value == "831260009" || element.value == "831260008")
optionSet.addOption(element);
if (element.value == "831260008" || element.value == "831260008")
optionSet.addOption(element);
});
}
Hello,
you can't do this using business rules, you have to write java script for this. You can refer sample here: http://crmdynamicblog.blogspot.com.au/2012/06/remove-item-from-picklist.html
Mohamed Amine Mahmoudi
83
Super User 2025 Season 1
Community Member
54
Victor Onyebuchi
6