none
选项集如何赋值? RRS feed

  • 问题

  • function RESTHelper() { }

    RESTHelper.prototype.Update = function (updateurl, entity) {
        var uptXmlHttpReq = new XMLHttpRequest();
        uptXmlHttpReq.open("POST", updateurl, false);
        uptXmlHttpReq.setRequestHeader("Accept", "application/json");
        uptXmlHttpReq.setRequestHeader("Content-Type", "application/json; charset=utf-8");
        uptXmlHttpReq.setRequestHeader("X-HTTP-Method", "MERGE");
        uptXmlHttpReq.send(entity);
        if (uptXmlHttpReq.readyState == 4) {
            if (uptXmlHttpReq.status == 204 || uptXmlHttpReq.status == 1223) {
                return true;
            }
            else {
                return false;
            }
        }
    }

    //marking account or contact
    function isselected_marking(gridControl,records,entityTypeCode)
    {
    var v_0="";
    var updateurl="";

    //marking account
    if(entityTypeCode==1)
    {
       for(var v_1=0;v_1<records.length;v_1++)
         {
            v_0=records[v_1].Id;
            updateurl="/"+Xrm.Page.context.getOrgUniqueName()+"/XRMServices/2011/OrganizationData.svc/AccountSet(guid'"+v_0+"')";
            var Helper=new RESTHelper();
            var isok;
            //Update
            myAccount=new Object();
            myAccount.new_marking=true;
            isok=Helper.Update(updateurl,JSON.stringify(myAccount));
         }
        alert("您所选择的客户已标记成功!");  

    }

    其中: myAccount.new_marking=true;(是用于二个选项的情况,正常)

    问题:现若new_marking是选项集类型,又要如何赋值?请高手点拔,谢谢!


    2012年11月28日 9:35

答案