Hi All,
I am trying to open new Case form within from existing one. During this process I want to pass certain field values from the old case.
Function is executing from field ’Priority’ on-change event. Once end user changes the priority new Case form pops up with certain field values of original case. All lookup and normal text and picklist fields are coming well except 'Description' field. (Out of the box field). It throws error saying expected 'SafeString' data type.
Below is a main part of the error:
========================================================================
<Message>System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: Expected 'SafeString' data type for 'description' parameter in 'Request.QueryString'. The raw request
===========================================================================
Below is trim down version of my code for simplicity purpose. I have put comments for your better understanding.
function NewCaseForm() { // Reading values from origianl case var parameters = {}; var title = Xrm.Page.getAttribute("title").getValue(); var customer = Xrm.Page.getAttribute("customerid").getValue(); var owner = Xrm.Page.getAttribute("ownerid").getValue(); var description = Xrm.Page.getAttribute("description").getValue(); alert(description); // this shows original description and this alert is working fine //Setting value to parameters //title - working parameters["title"] = title; //Customer- working parameters["customerid"] = customer[0].id.replace("{","").replace("}",""); parameters["customeridname"] = customer[0].name.toString(); parameters["customeridtype"] = "account"; //Owner- working parameters["ownerid"] = owner[0].id.replace("{","").replace("}",""); parameters["owneridname"] = owner[0].name.toString(); parameters["owneridtype"] = "systemuser"; //NOT WORKING = Throws error parameters["description"] = description.toString();
var options = {};
options ["openInNewWindow"] = true;
Xrm.Utility.openEntityForm("incident", null, parameters,options); }
Would anybody please shed some light on how to pass description field through this way of passing values and setting default values to newly opend case form.
Thanks for reading.
Regards,
J. Bachu
*This post is locked for comments