Dynamics 365 Unknown pagetype parameter passed on querystring
Dynamics 365 使用 Xrm.Utility.openEntityForm 打开窗体,报如下错误:
查报查错发现问题如下:
MSCRM Error Report: -------------------------------------------------------------------------------------------------------- Error: 引发类型为“System.Web.HttpUnhandledException”的异常。 Error Number: 0x80040216 Error Message: Unknown pagetype parameter passed on querystring Error Details: Unknown pagetype parameter passed on querystring Source File: Not available Line Number: Not available Request URL: https://crm.crop.cn/main.aspx?etc=10248&extraqs=%3fetc%3d10248%26new_accountid%3dC81AF5BF-5131-EA11-8AC9-A8FF1F0D8FEC%26new_accountidname%3d%25E4%25B8%25AD%25E5%25AE%2587%25E8%2581%2594%25E4%25BA%2591%25E8%25AE%25A1%25E7%25AE%2597%25E6%259C%258D%25E5%258A%25A1%25EF%25BC%2588%25E4%25B8%258A%25E6%25B5%25B7%25EF%25BC%2589%25E6%259C%2589%25E9%2599%2590%25E5%2585%25AC%25E5%258F%25B8%26new_change_type%3d20%26new_cust_name%3d%25E4%25B8%25AD%25E5%25AE%2587%25E8%2581%2594%25E4%25BA%2591%25E8%25AE%25A1%25E7%25AE%2597%25E6%259C%258D%25E5%258A%25A1%25EF%25BC%2588%25E4%25B8%258A%25E6%25B5%25B7%25EF%25BC%2589%25E6%259C%2589%25E9%2599%2590%25E5%2585%25AC%25E5%258F%25B8%26new_des%3d%25E5%2590%2588%25E5%2590%258C%25E4%25BA%25A7%25E5%2593%2581%25E5%2592%258C%25E9%2587%2591%25E9%25A2%259D%25E4%25B8%258D%25E5%258F%2598%25EF%25BC%258C%25E4%25BB%2598%25E6%25AC%25BE%25E6%2596%25B9%25E5%25BC%258F%25E5%258F%2598%25E6%259B%25B4%25E4%25B8%25BA%25E5%2590%258E%25E4%25BB%2598%25E8%25B4%25B9%26new_documenttemplate%3dfa054114-2862-ea11-8acc-aa932f065dea%26new_initial_contractid%3dC9482DB2-8133-EA11-8AC9-A8FF1F0D8FEC%26new_initial_contractidname%3dS-AB-01-19-00017%26new_is_need_report%3dfalse%26new_is_standard_clause%3dtrue%26new_name%3d%25E5%25BE%2590%25E6%25B1%2587%25E6%259C%258D%25E5%258A%25A1%25E5%2599%25A8%25E6%2589%2598%25E7%25AE%25A1%25E5%2590%2588%25E5%2590%258C%26new_overelec_compute_method%3d20%26new_overelec_unit_price%3d400%26new_pre_contractid%3d5E6A1132-0590-EA11-8ACC-AA932F065DEA%26new_pre_contractidname%3dHT20200208%26new_product_type_main%3d10%26new_quoteid%3d2C16A459-3937-EA11-8AC9-A8FF1F0D8FEC%26new_quoteidname%3d%25EF%25BC%2588%25E5%258E%2586%25E5%258F%25B2%25E6%2595%25B0%25E6%258D%25AE%25E5%25A4%2584%25E7%2590%2586%25EF%25BC%2589%25E4%25B8%25AD%25E5%25AE%2587%25E8%2581%2594%25E4%25BA%2591%25E8%25AE%25A1%25E7%25AE%2597%25E6%259C%258D%25E5%258A%25A1%25EF%25BC%2588%25E4%25B8%258A%25E6%25B5%25B7%25EF%25BC%2589%25E6%259C%2589%25E9%2599%2590%25E5%2585%25AC%25E5%258F%25B8%26new_use_period%3d12&histKey=200253163&newWindow=true&pagetype=entityrecord/default.aspx Stack Trace Info: [CrmException: Unknown pagetype parameter passed on querystring] 在 Microsoft.Crm.Web.MainPage.SetContentUrl() 在 Microsoft.Crm.Web.MainPage.ConfigurePage() 在 Microsoft.Crm.Application.Controls.AppUIPage.OnPreRender(EventArgs e) 在 Microsoft.Crm.Application.Controls.AppPage.OnPreRender(EventArgs e) 在 Microsoft.Crm.Application.Controls.PageManager.OnPreRender(EventArgs e) 在 System.Web.UI.Control.PreRenderRecursiveInternal() 在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) [HttpUnhandledException: 引发类型为“System.Web.HttpUnhandledException”的异常。] 在 System.Web.UI.Page.HandleError(Exception e) 在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 在 System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 在 System.Web.UI.Page.ProcessRequest() 在 System.Web.UI.Page.ProcessRequest(HttpContext context) 在 System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() 在 System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) 在 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
确认发现是pagetype=entityrecord参数放到了后面的原因,只需要把参数提前,如下:
https://crm.crop.cn/main.aspx?etc=10248&pagetype=entityrecord&extraqs=... 就可以解决。但因为是系统方法的缘故,无法修改。
查API发现下面方法可以解决问题
var entityFormOptions = {}; entityFormOptions["entityName"] = "new_contract"; Xrm.Navigation.openForm(entityFormOptions, paramerts).then( function (success) { console.log(success); }, function (error) { console.log(error); });