Hi all,
I have taken a simple scenerio, i have written a script that opens a new Entity Form from existing entity form. we all know the method "openEntityForm" to open any existing or new entity form. I have written a following code registered on Lead Entity and it will open Account:
function test(executionContext)
{
var context = executionContext.getFormContext();
var jobtitle = context.getAttribute("jobtitle").getValue();
var subject = context.getAttribute("subject").getValue();
var parameters={};
parameters["jobtitle"] = jobtitle;
parameters["subject"] = subject;
Xrm.Utility.openEntityForm("account",null,parameters);
}
but when this script executes it shows the following error
Unhandled exception:
Exception type: System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]
Message: System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.InvalidOperationException: CRM Parameter Filter - Invalid parameter 'jobtitle=Manager' in Request.QueryString on page /form/Data.aspx
The raw request was 'GET /form/Data.aspx?_CreateFromId=&_CreateFromType=&counter=1554732116452&etc=1&extraqs=%3fetc%3d1%26jobtitle%3dManager%26process%3d%26subject%3dNew%2520business2&formid=8448b78f-8f42-454e-8e2a-f8196b0419af&jobtitle=Manager&oid=&pagemode=iframe&pagetype=entityrecord&process=&subject=New%20business2' called from fiber7.crm.dynamics.com/main.aspx.
at Microsoft.Crm.Application.ParameterFilter.ValidateParameter(HttpRequest request, ArrayList parameterCollection, String key, String value, ParameterSources source, EntityType pageEntityType, FormAdditionalAllowedParameters additionalAllowedParameters)
at Microsoft.Crm.Application.ParameterFilter.ValidateParameters(Page page, EntityType pageEntityType, Boolean alwaysEnableParameterChecking, FormAdditionalAllowedParameters formAdditionalAllowedParametersTemp)
at Microsoft.Crm.Application.Controls.AppPage.ValidatePageParameters()
at Microsoft.Crm.Application.Controls.AppPage.OnInit(EventArgs e)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously): Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #88B8CCA9Detail:
<OrganizationServiceFault xmlns:i="www.w3.org/.../XMLSchema-instance" xmlns="schemas.microsoft.com/.../Contracts">
<ActivityId>f8558c98-a67f-47fc-81c7-ed67a965fad4</ActivityId>
<ErrorCode>-2147220970</ErrorCode>
<ErrorDetails xmlns:d2p1="schemas.datacontract.org/.../System.Collections.Generic" />
<Message>System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.InvalidOperationException: CRM Parameter Filter - Invalid parameter 'jobtitle=Manager' in Request.QueryString on page /form/Data.aspx
The raw request was 'GET /form/Data.aspx?_CreateFromId=&_CreateFromType=&counter=1554732116452&etc=1&extraqs=%3fetc%3d1%26jobtitle%3dManager%26process%3d%26subject%3dNew%2520business2&formid=8448b78f-8f42-454e-8e2a-f8196b0419af&jobtitle=Manager&oid=&pagemode=iframe&pagetype=entityrecord&process=&subject=New%20business2' called from fiber7.crm.dynamics.com/main.aspx.
at Microsoft.Crm.Application.ParameterFilter.ValidateParameter(HttpRequest request, ArrayList parameterCollection, String key, String value, ParameterSources source, EntityType pageEntityType, FormAdditionalAllowedParameters additionalAllowedParameters)
at Microsoft.Crm.Application.ParameterFilter.ValidateParameters(Page page, EntityType pageEntityType, Boolean alwaysEnableParameterChecking, FormAdditionalAllowedParameters formAdditionalAllowedParametersTemp)
at Microsoft.Crm.Application.Controls.AppPage.ValidatePageParameters()
at Microsoft.Crm.Application.Controls.AppPage.OnInit(EventArgs e)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously): Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #88B8CCA9</Message>
<Timestamp>2019-04-08T14:01:56.7382882Z</Timestamp>
<ExceptionRetriable>false</ExceptionRetriable>
<ExceptionSource i:nil="true" />
<InnerFault>
<ActivityId>f8558c98-a67f-47fc-81c7-ed67a965fad4</ActivityId>
<ErrorCode>-2147220970</ErrorCode>
<ErrorDetails xmlns:d3p1="schemas.datacontract.org/.../System.Collections.Generic" />
<Message>System.InvalidOperationException: CRM Parameter Filter - Invalid parameter 'jobtitle=Manager' in Request.QueryString on page /form/Data.aspx
The raw request was 'GET /form/Data.aspx?_CreateFromId=&_CreateFromType=&counter=1554732116452&etc=1&extraqs=%3fetc%3d1%26jobtitle%3dManager%26process%3d%26subject%3dNew%2520business2&formid=8448b78f-8f42-454e-8e2a-f8196b0419af&jobtitle=Manager&oid=&pagemode=iframe&pagetype=entityrecord&process=&subject=New%20business2' called from fiber7.crm.dynamics.com/main.aspx.
at Microsoft.Crm.Application.ParameterFilter.ValidateParameter(HttpRequest request, ArrayList parameterCollection, String key, String value, ParameterSources source, EntityType pageEntityType, FormAdditionalAllowedParameters additionalAllowedParameters)
at Microsoft.Crm.Application.ParameterFilter.ValidateParameters(Page page, EntityType pageEntityType, Boolean alwaysEnableParameterChecking, FormAdditionalAllowedParameters formAdditionalAllowedParametersTemp)
at Microsoft.Crm.Application.Controls.AppPage.ValidatePageParameters()
at Microsoft.Crm.Application.Controls.AppPage.OnInit(EventArgs e)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint): Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #8B78329C</Message>
<Timestamp>2019-04-08T14:01:56.7382882Z</Timestamp>
<ExceptionRetriable>false</ExceptionRetriable>
<ExceptionSource i:nil="true" />
<InnerFault i:nil="true" />
<OriginalException i:nil="true" />
<TraceText i:nil="true" />
</InnerFault>
<OriginalException i:nil="true" />
<TraceText i:nil="true" />
</OrganizationServiceFault>
*This post is locked for comments
Thanks to all, My script is working now, Actually i was not taking the correct Target Entity fields logical name in script.
For example the current Entity is Lead and the Target Entity that will be opened is Account, so i have to take Account's field logical name in My script
var parameters = {};
parameters["new_name"] = "ABCD";
Xrm.Utility.openEntityForm("account", null, parameters);
here Field with Logical name as "new_name" must be present in Target entity that we want to open on any event from current entity.
In my scenario the current entity is Lead and Target Entity is Account
Hi Ishan,
Try below code. Xrm.Utility.openEntityForm is being deprecated so may face issue. Thanks.
function test(executionContext)
{
var context = executionContext.getFormContext();
var jobtitle = context.getAttribute("jobtitle").getValue();
var subject = context.getAttribute("subject").getValue();
var entityFormOptions = {};
entityFormOptions["entityName"] = "account";
var parameters={};
parameters["jobtitle"] = jobtitle;
parameters["subject"] = subject;
// Open the form.
Xrm.Navigation.openForm(entityFormOptions, parameters).then(
function (success) {
console.log(success);
},
function (error) {
console.log(error);
});
}
Hi All,
I tried a lot but still my script is now working. below is my very simple code
function test(executionContext)
{
debugger;
var context = executionContext.getFormContext();
var parameters = {};
parameters["qryParam_safestring"] = "Test";
Xrm.Utility.openEntityForm("account", null, parameters);
}
My script triggers at OnSave event of Lead and it should open a Account. It is working fine if don't pass parameter in openEntityForm method
Hi Ishan,
The parameter you are passing which should be either field name (Field should be available in the form) or custom parameter (which you need to defined in the form properties) . If you are passing field name then I think the field name you are passing is wrong , should be with publisher name. Also make sure the value assignment of any parameter also depends on field type. see here -
Below sample code is working form me , see the field name available in the account form.
function test(executionContext) { var parameters = {}; parameters["telephone1"] = "test title"; parameters["websiteurl"] = "http://test.com"; //parameters["jobtitle"] = "test"; //parameters["subject"] = "GDSS"; var windowOptions = { openInNewWindow: true }; Xrm.Utility.openEntityForm("account", null, parameters, windowOptions); }
If you are passing custom parameter make sure you have create parameter. For more info see here -
This is deliberate. CRM blocks unexpected querystring parameters. You can pass additional parameters as part of the extraqs parameter, which will also populate fields with that name, if that is what you're using the parameter for.
If you have CRM OnPremise, you can disable the parameter filtering adding a DWORD registry value HKEY_Local_Machine\Software\Microsoft\MSCRM\DisableParameterFilter = 1
Mohamed Amine Mahmoudi
83
Super User 2025 Season 1
Community Member
54
Victor Onyebuchi
6