CRM 4.0 set lookup search to like clause instead of equals RRS feed

  • General discussion

  • Hi,

    This may be a basic question, so please forgive!

    In CRM 4.0 within our cases we have a lookup field for Accounts, when searching within this lookup for an account, the clause appears to be equal as opposed to a like, as I'd expect in a search.

    So for example if I have account, "hello world" & I want to pick this account in the lookup field, I can't search for world, I have to search for the term at the beginning of the account name, so hello. I was just wondering if anyone is aware of a way to get the search to perform on a like clause instead of an equals clause (excuse my SQL comparison).


    • Changed type jhawes Monday, September 16, 2013 9:17 AM
    Friday, September 13, 2013 3:13 PM

All replies

  • Ok, so a user can enter *world, as per above example, it's just not the most user friendly option.

    If anyone knows of any config changes that I could make to enable this, it would be much appreciated.

    Friday, September 13, 2013 3:36 PM
  • try

    SELECT * FROM FilteredAccount WHERE name LIKE '%Microsoft'
    SELECT * FROM FilteredAccount WHERE name LIKE '%Microsoft%'

    SELECT * FROM FilteredAccount WHERE accountidname LIKE '%Microsoft%'

    Regards Faisal

    Friday, September 13, 2013 3:39 PM
  • Thanks Faisal, that would work if I was querying the DB directly, however within the CRM UI, I don't think I'd be able to set the search on a lookup field to use the SQL statement

    If you know of a way I could, then by all means please let me know.

    Thanks though!

    Friday, September 13, 2013 3:43 PM
  • Use fetchXML
    <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
      <entity name="account">
        <attribute name="name" />
        <order attribute="name" descending="false" />
        <filter type="and">
          <condition attribute="name" operator="like" value="Hello World%" />

    Regards Faisal

    Monday, September 16, 2013 8:29 AM
  • Thanks again Faisal,

    This may be me, not quite seeing the forest through the trees, but in order to get CRM 4.0 to perform a decent search, I'm getting the impression I need to develop a custom search as opposed to using the OOTB functionality, does that sound right?
    I'm assuming I can't append a dynamic fetchxml statement to the OOTB UI search functionality.

    I'm just trying to establish whether the search functionality that comes in CRM 4.0 is actually designed to perform this way, or whether there is a slight config. issue with our implementation of CRM.

    For example, currently if I'm accessing CRM through the browser, I navigate to the Organisations/account entity, they're currently listed in alphabetical order by Organisation/account name, I have an organisation named, this is company one, in order to retrieve that through the OOTB search an end user has no choice but to search t, or th, or thi or this  is etc, they can't just enter one or company and find it through the ootb search functionality, without also including the * wildcard.



    Monday, September 16, 2013 8:59 AM
  • You will have to use * while seaching in Quick find box. You have few options:-

    1. Create a advance find view and save it and share it will all the users. They will get this view in their own views and they can use this for searching.

    2. Create a HTML page for searching. You can show this page in an iframe. You can have a similar look and feel as advanced find.

    3. Create aspx page for searching.

    Regards Faisal

    Monday, September 16, 2013 9:11 AM
  • Ok cool, thanks a lot for that Faisal, it's much appreciated!

    Monday, September 16, 2013 9:18 AM