문제

Hi i have an odata query which works perfectly fine in internet explorer 8 and above but not for internet explorer 7. I am hoping there is some kind of compatibility line i can insert somewhere before i go and create a different query method.

function setPriceListFromCurrency() {

var pricelevel = Xrm.Page.getAttribute("pricelevelid");
var currencyid = Xrm.Page.getAttribute("transactioncurrencyid").getValue();
if (currencyid == null) return;
SDK.REST.retrieveMultipleRecords("PriceLevel","?$select=PriceLevelId,Name&$filter=TransactionCurrencyId/Id eq guid'"+currencyid[0].id.substr(1, 36)+"'&$top=1",

    function (results)
    {
        //Results handler

        var pricelevelrecord = results[0];
        if (pricelevelrecord != null)
        {
            pricelevel.setValue(
            [{
            id: pricelevelrecord.PriceLevelId,
            name: pricelevelrecord.Name,
            entityType: 'pricelevel'
            }]
            );
        }
        else
        {
            alert("No Pricelist records are available with this currency.");
            pricelevel.setValue(null);
        }
    },

    function (error)
    {
        //Error handler
        alert(error.message);
        pricelevel.setValue(null);
    },
    function ()
    {
       //Complete handler
    }
  );

}

도움이 되었습니까?

해결책

This question has been answered! the problem is due to the SDK.REST with the comment below. Internet Explorer does not support JSON.parse before version 8. You may use jQuery.parseJSON instead

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top