locked
fuzzy query in CRM 2011 RRS feed

  • Question

  • Here is my code

    <condition attribute='name' operator='like' value='%" + name + "%' />

    if name is word ,like 'a' 'b' ,there's no problem

    if name is '&' an exception is thrown

    Friday, January 3, 2014 6:36 AM

All replies

  • Escape &

    &           &amp;

    <            &lt;      

     >            &gt;

    '              &apos;

    "             &quot;


    Use:  name = System.Security.SecurityElement.Escape(name);
    • Proposed as answer by Jan AS Friday, January 3, 2014 8:58 AM
    • Edited by Jan AS Friday, January 3, 2014 10:06 AM
    Friday, January 3, 2014 8:57 AM