我有一个场景,我在我的CRM服务器上托管了一个外部网站,当我尝试使用JavaScript打开这个网站我得到一个SCRIPT5:访问被拒绝错误,我知道这与我的事实有关网站与CRM服务器不在同一个域中,我的外部网站是HTTPS托管但不同的端口和服务器作为CRM,我不能将我的网站设置为CRM托管的serv3er,因为它将在IIS中覆盖它。我怎么能克服这个问题,请heklp,看看下面我的JS代码:
function PassOpgParameters(opgRoe,opgFactor,opgMargin,opgIdentifier) {
var Upload = "User OPG Upload";
Xrm.Page.getAttribute("new_name").setValue(Upload);
var roe = Xrm.Page.getAttribute("new_roe").getValue();
var factor = Xrm.Page.getAttribute("new_factor").getValue();
var margin = Xrm.Page.getAttribute("new_margin").getValue();
var opgID = Xrm.Page.getAttribute("new_opgid").getValue();
var encodeUrlParameter = "?data=" + encodeURIComponent('&opgRoe=roe&opgFactor=factor&opgMargin=margin&opgIdentifier=opgID');
var url = "https://xxxxx.tarsus.co.za/" + encodeUrlParameter; //this url is different to CRM hosted server
var DialogOptions = new Xrm.DialogOptions();
DialogOptions.width = 540;
DialogOptions.height = 305;
Xrm.Internal.openDialog(url, DialogOptions, null, null, function (dialogResult) {
if (dialogResult != null) {
Xrm.Page.getAttribute("new_dialogresults").setValue(dialogResult);
Xrm.Page.data.entity.save();
}
});