locked
Set multiple seach values in Advanced Find RRS feed

  • Question

  • Hi everyone,

    I'm trying to search a set of records by their county names. I have around 50 county names that I'm suppose to match in a single search. They are not a picklist, just a text field. Is there a way I can set a condition in Advance Find to search for all these 50 names in one statement (such as If county Equals/Contains county1;county2;county3 etc) instead of having to enter a separate row for each county? I have like 100 different regions that I need to do this for, so if there is an easier/better way that would be awesome!! I really appreciate if you could help me figure this out.

    Thanks!!

    Friday, December 3, 2010 5:59 PM

Answers

  • Hi,

    I've come across this issue before several times ...

    One way to do this is:
    1. Put together a sample Advanced Find with an OR statement around two of the County values (text field)
    2. Click "Find" and then push F12 to get the Developer Toolbar.
    3. Capture the FetchXml code for the Advanced Find query (this is so that you know how the OR clause is structured) using:

    document.all.FetchXml.value
    

    4. Copy and Paste into Excel (for example) and use a formula to generate the code for the additional criteria lines which you want to include (ie. for the other County values)
    5. Close and re-open the Advanced Find (make sure you select the entity to filter again) and inject the updated/extended FetchXml query back into your Advanced Find, follow instructions on:
    http://xrmmatrix.blogspot.com/2010/08/using-advanced-find-to-graphically.html

    Your Advanced Find criteria should now be updated to reflect your additional criteria.

    This really should (natively) be a simpler task but unfortunately, this is the easiest way we've come across so far - otherwise you manually have to add the individual lines.

    Hope this helps!

    Thanks,
    Maryse


    The xRM Architect:
    • Marked as answer by bill90 Tuesday, December 7, 2010 7:47 PM
    Saturday, December 4, 2010 10:06 AM
  • Thanks for you input guys.

    I ended up going over the CRM SQL tables in the backend and running queries to directly update the values. I know it's not the recommended way, but it was a lot less complicated and got the job done a lot faster than I thought.

    But thank you for suggesting that workaround, Maryse. I'm sure it will be a great reference for a lot of people dealing with this kind of situations.

     

    • Marked as answer by bill90 Tuesday, December 7, 2010 7:47 PM
    Tuesday, December 7, 2010 7:47 PM

All replies

  • With text fields, the Advanced Find is too limited in this way to support the functionality you're seeking.  My experience is that you'll need to use separate statements for each possible value.  Perhaps in the future, it would be worth considering capturing these possible values as records of a custom entity, or options in a Picklist.  Then, you could use a single statement in an Advanced Find.

    Dave Berry - MVP Dynamics CRM - http:\\crmentropy.blogspot.com Please follow the forum guidelines when inquiring of the dedicated CRM community for assistance.
    Saturday, December 4, 2010 3:48 AM
    Moderator
  • Hi,

    I've come across this issue before several times ...

    One way to do this is:
    1. Put together a sample Advanced Find with an OR statement around two of the County values (text field)
    2. Click "Find" and then push F12 to get the Developer Toolbar.
    3. Capture the FetchXml code for the Advanced Find query (this is so that you know how the OR clause is structured) using:

    document.all.FetchXml.value
    

    4. Copy and Paste into Excel (for example) and use a formula to generate the code for the additional criteria lines which you want to include (ie. for the other County values)
    5. Close and re-open the Advanced Find (make sure you select the entity to filter again) and inject the updated/extended FetchXml query back into your Advanced Find, follow instructions on:
    http://xrmmatrix.blogspot.com/2010/08/using-advanced-find-to-graphically.html

    Your Advanced Find criteria should now be updated to reflect your additional criteria.

    This really should (natively) be a simpler task but unfortunately, this is the easiest way we've come across so far - otherwise you manually have to add the individual lines.

    Hope this helps!

    Thanks,
    Maryse


    The xRM Architect:
    • Marked as answer by bill90 Tuesday, December 7, 2010 7:47 PM
    Saturday, December 4, 2010 10:06 AM
  • Thanks for you input guys.

    I ended up going over the CRM SQL tables in the backend and running queries to directly update the values. I know it's not the recommended way, but it was a lot less complicated and got the job done a lot faster than I thought.

    But thank you for suggesting that workaround, Maryse. I'm sure it will be a great reference for a lot of people dealing with this kind of situations.

     

    • Marked as answer by bill90 Tuesday, December 7, 2010 7:47 PM
    Tuesday, December 7, 2010 7:47 PM