Dear Team,
I am facing one issue.
Problem Description: Based on Product category and product Type (combination) i need to filter the product lookup using java script.
If Product category or product type contains '&' symbol then the product filetering is not working. The following is the code.
var PCID = Xrm.Page.data.entity.attributes.get("ccs_product_category").getValue()[0].id;
var PCName = Xrm.Page.data.entity.attributes.get("ccs_product_category").getValue()[0].name;
PCName = PCName.replace("&", "&");
var PTID = Xrm.Page.data.entity.attributes.get("ccs_product_type").getValue()[0].id;
var PTName = Xrm.Page.data.entity.attributes.get("ccs_product_type").getValue()[0].name;
PTName = PTName.replace("&", "&");
var fetchXml = "";
fetchXml += "<filter type='and'>";
fetchXml += "<condition attribute='ccs_product_category' value='" + PCID + "' uiname='" + PCName + "' uitype11='ccs_product_category' operator='eq'/>";
fetchXml += "<condition attribute='ccs_product_type' value='" + PTID + "' uiname='" + PTName + "' uitype='ccs_product_type' operator='eq'/>";
fetchXml +="</filter>";
alert(fetchXml);
Xrm.Page.getControl("ccs_product").addCustomFilter(fetchXml);
Regards,
Sreenath