Hey everyone,
In Dynamics CRM 365 (On-Premise), I am having issues trying to pass a customer name from one entity to another and having the string get decoded correctly.
On my incident entity, I have a ribbon button that opens a custom entity and passes a customer name with the following code snippet:
var parameters = "";
parameters += "¶meter_customerName=" + "This is a customer name with & symbol";
window.open("/main.aspx?etn=customEntity&pagetype=entityrecord&extraqs=" + encodeURIComponent(parameters), "_blank", features, false);
Now the code for the onLoad event for the custom Entity:
var parameters = Xrm.Page.context.getQueryStringParameters();
var passedCustomerName = parameters["parameter_customerName"];
alert(passedCustomerName);
var passedCustomerNameDecoded = decodeURIComponent(parameters["parameter_customerName"]);
alert(passedCustomerNameDecoded);
Both alerts are showing me the same string of text which is: This is a customer name with
However, the URL of the custom entity does have the fully encoded parameter - parameter_customerName%3DThis%20is%20a%20customer%20name%20with%20%26%20symbol
I am aware that window.open should not be used in place of Xrm.Utility.openEntityForm but I have some business requirements that I can meet with window.open such as choosing a window size.
Any suggestions would be greatly appreciated and I'm hopeful that I am simply just decoding this incorrectly.
Thank you,
*This post is locked for comments