XrmServicetoolkit special characters in SOAP call from web resource RRS feed

  • Question

  • I am trying to retrieve data from a web resource html page.  I have a listbox with values on the html page and I want to retrieve data based on the listbox value:

    <select id="Product_Group"> <option value="*">All</option> <option value="AutoCAD">AutoCAD</option> <option value="AEC & ENI">AEC & ENI</option>


    In my java on the webpage I have

    var fetchXml =

    "<fetch mapping='logical'>" + "<entity name='product'>" + "<attribute name='productid' />" + "<attribute name='productnumber' />" + "<attribute name='name' />" + "<attribute name='defaultuomid' />" + "<attribute name='prknc_productgroup'/>" + condition+ "</entity>" + "</fetch>";

    Where condition the value is from my listbox

    I make the SOAP call like this

    var retrievedProducts = window.parent.XrmServiceToolkit.Soap.Fetch(fetchXml);

    This works fine under normal circumstances, but I have an issue with the '&' character.
    I get an error: "cannot convert the XML string to a cross-browser XML object"

    I have tried

    <option value="AEC &amp; ENI">AEC & ENI</option>


    <option value="AEC &#38; ENI">AEC & ENI</option>

    Non of these are working.

    Please vote if you find my post useful. Add me on Skype @ christo.skype1

    Tuesday, May 6, 2014 2:52 PM

All replies

  • Are you already using the latest version of XrmServicetoolkit? FetchXML can certainly support "&" if it is encoded properly. This seems to be an issue within the toolkit. You are better off posting this to CodePlex.


    Tuesday, May 6, 2014 3:40 PM