locked
CRM 2011, special characters in view RRS feed

  • Question

  • I have the requirment to modify the filter criteria of the "Active Product" system view to filter the products with some asterisks in the name:

    Ex:

    *Product1

    **Product2

    ***Product3

    I tried with:

    /* or [*] but I can't filter the view.

    Can you help me please?

    Simona

    Thursday, March 1, 2012 3:00 PM

Answers

  • Hi Simona,

    When you enter a * into the view filter (or any search/advanced find) CRM reads this as a wildcard, which is actually written as % in the fetchXML. There doesn't seem to be any way to enter a * into the front end as an actual search character. 

    If you look at the fetch query generated when searching for 'contains' * you get:

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

    Where the middle % is the * you entered, and the outer % are the wildcard searches.

    However this can be modified for Javascript fetchXML queries and reports, just change the middle % to a * which produces the filtering you require:

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

    This does not solve your issue with the view, however you could run a fetchXML report using the custom filter instead, or modify the filter with Javascript.

    I hope someone else can provide an actual escape method for the * in views. Good luck.

    Regards,

    Paul

    • Marked as answer by SimonaP Friday, March 2, 2012 10:42 AM
    Friday, March 2, 2012 10:03 AM

All replies

  • When you say you need to fitler with an *, does the product name in question contain the * or are you expecting it to act as a wild card? 

    If it's a wild card, you can use the "contains"  custom filter option to filter via prodcut name.

    --Jerry [msft]

    Thursday, March 1, 2012 7:38 PM
  • It isn't a wilcard! It is contained in the name of the products, but I can not make it clear to the CRM! What special character have I to put before the asterisk so that the CRM doesn't consider it a wildcard?

    Thank you,

    Simona

    Friday, March 2, 2012 8:02 AM
  • Hello Simona,

    If it is possible,  try to encode the character as a Html chracter, the code is "&#42;" for *.

    Regards,

    Alexandre

    Friday, March 2, 2012 8:39 AM
  • Hi Alex,

    I have just tried your solution but it doesn't work, unfortunately.

    Tks

    Simona

    Friday, March 2, 2012 8:47 AM
  • To understand, you want to create a filterered view who search products with the name begin by "*"?

    The actual result is that CRM take the "*" as a wildcard and return alls products but not precisely products beginning by "*" ? 

    If I don't understand correctly, can you send screen capture of what you want to do ?

    Friday, March 2, 2012 8:58 AM
  • Hi Simona,

    When you enter a * into the view filter (or any search/advanced find) CRM reads this as a wildcard, which is actually written as % in the fetchXML. There doesn't seem to be any way to enter a * into the front end as an actual search character. 

    If you look at the fetch query generated when searching for 'contains' * you get:

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

    Where the middle % is the * you entered, and the outer % are the wildcard searches.

    However this can be modified for Javascript fetchXML queries and reports, just change the middle % to a * which produces the filtering you require:

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

    This does not solve your issue with the view, however you could run a fetchXML report using the custom filter instead, or modify the filter with Javascript.

    I hope someone else can provide an actual escape method for the * in views. Good luck.

    Regards,

    Paul

    • Marked as answer by SimonaP Friday, March 2, 2012 10:42 AM
    Friday, March 2, 2012 10:03 AM
  • Thank you for your answer Paul.

    I imagined that there was no way to achieve the requirement without js or custom fetchXML report.

    Simona

    Friday, March 2, 2012 10:42 AM