Requirements:Based on the selection of different "Reflection categories", Shuai selects different "Reflection content ".
Field description:Reflected category: hxcs_feedbacktype; reflected content: hxcs_feedbacktype
Solution:To set the association between two option sets, we can perform some special processing when setting values for the two option sets. For example, if the value of a category is 00001, 100100001, the corresponding content can be set to category value +, that is, and so on. For example:
The JS Code is as follows:
function onFeedBackTypeChange() { var _feedbackcontent = Xrm.Page.getControl("hxcs_feedbackcontent").getAttribute().getOptions(); var backType = Xrm.Page.getControl("hxcs_feedbacktype").getAttribute().getValue(); Xrm.Page.getControl("hxcs_feedbackcontent").clearOptions(); if (backType == null) return; backType = backType.toString(); var iLen = _feedbackcontent.length; var iPos = 0; for (var i = 0; i < iLen; i++) { if (_feedbackcontent[i].value.substr(0, backType.length) == backType) { Xrm.Page.getControl("hxcs_feedbackcontent").addOption(_feedbackcontent[i], iPos); iPos++; } } Xrm.Page.getControl("hxcs_feedbackcontent").getAttribute().setValue(null);}