3. Practice of crm2011 programming-Implementation of association between option sets (drop-down boxes)

Source: Internet
Author: User

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);}



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.