我的組織已從CRM 2011升級到CRM 2016 SP1。CRM 2016「CRM參數篩選器 - 無效的參數」
在CRM 2011中,我們爲幾個不支持該功能的表單添加了一個自定義的「查找地址」按鈕。
當然,升級後,此代碼停止運行,我一直在嘗試更新它。最初,在升級之後,按鈕並沒有做任何事情。但是,進行一些更改後,按鈕「有效」,但會產生以下錯誤。
<?xml version="1.0"?>
-<error xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<exception>Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: System.InvalidOperationException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #C1D5F608Detail: <OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts"> <ErrorCode>-2147220970</ErrorCode> <ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" /> <Message>System.InvalidOperationException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #C1D5F608</Message> <Timestamp>2016-11-29T19:51:26.801987Z</Timestamp> <InnerFault i:nil="true" /> <TraceText i:nil="true" /> </OrganizationServiceFault> </exception>
<parameters xsi:nil="true"/>
<displaytitle/>
<displaytextencoded/>
<displaytext/>
<description>CRM Parameter Filter - Invalid parameter 'headerForm=1' in Request.QueryString on page /CRMTest/Handlers/WebResource.ashx The raw request was 'GET /CRMTest/{636160451970000359}/WebResources/CRMTest/sfa/quotes/dlg_lookupaddress.aspx?Data=LookupAddress&headerForm=1&parentId=%7bDB4A56CB-6809-E511-91A1-0050569C003F%7d&parentType=1&willCall=0' called from .</description>
<file>Not available</file>
<line>Not available</line>
<details>Not available</details>
<traceInfo/>
<requesturl>http://azcrmdev/CRMTest/Handlers/WebResource.ashx?name=CRMTest/sfa/quotes/dlg_lookupaddress.aspx&Data=LookupAddress&headerForm=1&parentId=%7bDB4A56CB-6809-E511-91A1-0050569C003F%7d&parentType=1&willCall=0</requesturl>
<pathAndQuery>/CRMTest/Handlers/WebResource.ashx?name=CRMTest/sfa/quotes/dlg_lookupaddress.aspx&Data=LookupAddress&headerForm=1&parentId=%7bDB4A56CB-6809-E511-91A1-0050569C003F%7d&parentType=1&willCall=0</pathAndQuery>
<source>ASHX_XML</source>
<stacktrace/>
</error>
我已經使用「extraqs」參數「 encodeURIComponant」嘗試,並甚至名稱添加的參數的形式本身。這些都是我在研究中發現的所有可能的解決方案(包括這裏的SO)。然而,大多數解決方案似乎都是針對2011年的。我也讀過,這從升級到SP1以來可能根本不起作用。現在我已經輪了幾天車輪。
任何有識之士將不勝感激。
這是我到目前爲止的代碼(違規代碼行包含在「**」中)。
function CustomLookup() {
//debugger
//var aoItems = getFieldValue("customerid");
var aoItems = Xrm.Page.getAttribute("customerid").getValue();
if (aoItems == null) {
alert("Account is not Selected");
return;
}
**var object = Xrm.Utility.openWebResource(Xrm.Page.context.prependOrgName("/sfa/quotes/dlg_lookupaddress.aspx?headerForm=1&parentType=1&parentId=" + aoItems[0].id + "&willCall=0"), "LookupAddress", 500, 330, true);**
//debugger
if (object) {
if (object.BillTo && object.ShipTo) {
retrieveRecordXrm(object.Address.AddressId, "CustomerAddressSet", populateBillShipAddress, retrievalFailed, true);
}
else if (object.BillTo) {
retrieveRecordXrm(object.Address.AddressId, "CustomerAddressSet", populateBillAddress, retrievalFailed, true);
}
else if (object.ShipTo) {
retrieveRecordXrm(object.Address.AddressId, "CustomerAddressSet", populateShipAddress, retrievalFailed, true);
}
}
}
你可以嘗試使用上引用的標準按鈕,使用開發工具來捕捉觸發URL。自升級以來,很可能某個參數(headerForm)發生了變化... – Nathan