While passing text as a parameter in fetchXml in CRM OnLoad/OnSave/OnChange event Jscript, it required to xmlencode the text before use the same as parameter.
This is because the fetchXml contains “&” or single quote(‘) is not executed in Jscript CRM service call.
function xmlencode(string) {
return string.replace(/\&/g,'&'+'amp;').replace(//g,'&'+'gt;').replace(/\'/g,'&'+'apos;').replace(/\"/g,'&'+'quot;');
}
This is because the fetchXml contains “&” or single quote(‘) is not executed in Jscript CRM service call.
function xmlencode(string) {
return string.replace(/\&/g,'&'+'amp;').replace(//g,'&'+'gt;').replace(/\'/g,'&'+'apos;').replace(/\"/g,'&'+'quot;');
}
No comments:
Post a Comment