我想启用可共享的网址(显示为 https://crm.myorg.com/main.aspx?etc=X&extraqs=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&pagetype=XXXXXXX )直接显示在地址栏中,而不必点击“通过电子邮件发送链接”并从中检索网址那里。现在,每个页面都会将网址显示为 https://crm.myorg.com/main.aspx#XXXXXXXX
有办法吗?我正在使用MS CRM Dynamics 2013内部部署。
谢谢。
答案 0 :(得分:1)
我已经设法用JS黑客解决了这个问题。
SetAddressBarAsFormShortcut()
函数请注意,遗憾的是,无法全局启用此行为(除非修改Microsoft的JS文件),并且它仅适用于支持history.pushState()方法的浏览器。
function UpdateAddressBar(entityTitle, recordId, entityLogicalName) {
var $v_0 = Mscrm.CrmUri.create(window.location.href);
if (Mscrm.SessionInfo.isOutlookLaptopClient() && !Mscrm.SessionInfo.isOnline()) {
var $v_2 = window.location.href, $v_3 = window.location.pathname;
$v_0 = Mscrm.CrmUri.create(Mscrm.Help.concatenateUrl(window.WEB_APP_URL, $v_2.substr($v_2.indexOf($v_3))));
$v_0.set_useOrganizationName(false)
}
if (!Mscrm.Utilities.isNewPageModel($v_0)) {
$v_0 = Mscrm.Utilities.removeExtraQSParameters($v_0, Mscrm.Utilities.getRecordPageQueryStringParams());
if (Mscrm.InternalUtilities.EntityNames.Calendar === entityLogicalName && (IsNull($v_0.get_query()["id"]) || isNullOrEmptyString($v_0.get_query()["id"])) && !IsNull(recordId)) {
$v_0.get_query()["calendarId"] = recordId;
$v_0.get_query()["calendarType"] = 1;
$v_0 = Mscrm.Utilities.removeExtraQSParameters($v_0, ["calendarId", "calendarType"])
}
} else {
$v_0 = Mscrm.Utilities.getPageUrl($v_0, "entityrecord");
delete $v_0.get_query().pagemode;
if (!IsNull(recordId))
$v_0.get_query()["id"] = recordId;
delete $v_0.get_query().extraqs;
var $v_4 = $find("crmFormSelector");
if ($v_4)
$v_0.get_query()["extraqs"] = "formid=" + CrmEncodeDecode.CrmUrlEncode($v_4.$r_3)
}
$v_0 = $v_0.toString();
$v_0 = $v_0.substring($v_0.indexOf("main.aspx"));
top.onpopstate = function(){top.history.pushState("", "", "main.aspx"); top.onpopstate = null; top.history.go(-2)};
top.history.pushState("", "", $v_0);
};
function SetAddressBarAsFormShortcut() {
var $v_0 = Xrm.Page.data.entity;
UpdateAddressBar(CrmEncodeDecode.CrmHtmlDecode($v_0.getPrimaryAttributeValue()), $v_0.getId(), $v_0.getEntityName())
}
(上面的代码基于Microsoft在Email a link
/ Copy a link
函数中使用的代码)
答案 1 :(得分:0)
地址栏中无法与CRM 2013共享URL。
您需要通过E-mail a Link
或Copy a Link
函数获取链接。