gpt4 book ai didi

javascript - odata 查询在 ie 7 中不起作用

转载 作者:行者123 更新时间:2023-11-28 08:33:54 25 4
gpt4 key购买 nike

嗨,我有一个 odata 查询,它在 Internet Explorer 8 及更高版本中工作得很好,但不适用于 Internet Explorer 7。我希望在我去之前可以在某处插入某种兼容性行并创建不同的查询方法。

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

}

最佳答案

这个问题已经有答案了!该问题是由于 SDK.REST 引起的,注释如下。 Internet Explorer 在版本 8 之前不支持 JSON.parse。您可以使用 jQuery.parseJSON 代替

关于javascript - odata 查询在 ie 7 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21483104/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com