﻿function OpenPopUp_DownloadOptions(_primaryEntityTypeName, _firstPrimaryItemId) {
    var url = _getUrl() + "/WebResources" + "/iotap_DownloadOptions.htm";
    var webResourceData = encodeURIComponent(_primaryEntityTypeName + '|' + _firstPrimaryItemId);
    //Xrm.Utility.openWebResource(url, webResourceData, 430, 500)
    var features = "location=no,menubar=no,status=no,toolbar=no,resizable=yes,width=400,height=325,top=200,left=500";
    window.open(url + "?Data=" + webResourceData, "_blank", features, false);
}

function _getUrl()
{
    var url = Xrm.Page.context.getClientUrl();    
    return url;
};