locked
CRM 2011: Extend search function in Look Up Record? RRS feed

  • Question

  • Is it possible to extend the search function in Look Up Record?

    Scenario:
    User create new Case, open up Look Up Record window to look for Customer. However, here the user should have the abillity to search in an external datasource too and not only the CRM database. If records are found in the external database, the user should be able to create a new Customer with some values filled in from the found record in the external datasource.

    Is something like this possible to do?


    Thursday, August 25, 2011 7:49 AM

Answers

  • you can develop a plugin for retrieve message, but the plugin will slow down the system performance.


    daemon lin
    Thursday, August 25, 2011 7:53 AM
  • Hi Jimmy-san,

    Following on from daemon lin, you could develop a plugin that is registered on the Post RetrieveMultiple step for Contact/Account - this would intercept the Query and add in any additional results from the external data source as additional entity records.

    In your plugin, first you would get the query used by the search window:

    QueryBase query = (QueryBase)executionContext.InputParameters["Query"]
    

    Then you would get the Results set already returned from the CRM Database:

    EntityCollection collection = (EntityCollection)executionContext.OutputParameters["BusinessEntityCollection"];
    
    Then you can query your external data source and add in Entity Records to the output collection.

    The challenge would be that if the external records don't have corresponding CRM Records, you would also need to register a step on 'Retrieve' and spoof the Unique Identifiers so that when a user clicks on a particular record in the results, the corresponding record displayed is the data from the external data source. I really wouldn't advise this.

    If you don't have CRM ID's for the external records, it may be cleaner to completely replace the 'Customer' lookup with a Silverlight resource that can combine the CRM and external data source search into a single view and control how the user selects the records from the external data source, and force a new CRM record to be created if one doesn't already exist.

    Hope this helps,

    Scott


    www.develop1.net
    Thursday, August 25, 2011 8:46 AM
    Answerer

All replies

  • you can develop a plugin for retrieve message, but the plugin will slow down the system performance.


    daemon lin
    Thursday, August 25, 2011 7:53 AM
  • Hi Jimmy-san,

    Following on from daemon lin, you could develop a plugin that is registered on the Post RetrieveMultiple step for Contact/Account - this would intercept the Query and add in any additional results from the external data source as additional entity records.

    In your plugin, first you would get the query used by the search window:

    QueryBase query = (QueryBase)executionContext.InputParameters["Query"]
    

    Then you would get the Results set already returned from the CRM Database:

    EntityCollection collection = (EntityCollection)executionContext.OutputParameters["BusinessEntityCollection"];
    
    Then you can query your external data source and add in Entity Records to the output collection.

    The challenge would be that if the external records don't have corresponding CRM Records, you would also need to register a step on 'Retrieve' and spoof the Unique Identifiers so that when a user clicks on a particular record in the results, the corresponding record displayed is the data from the external data source. I really wouldn't advise this.

    If you don't have CRM ID's for the external records, it may be cleaner to completely replace the 'Customer' lookup with a Silverlight resource that can combine the CRM and external data source search into a single view and control how the user selects the records from the external data source, and force a new CRM record to be created if one doesn't already exist.

    Hope this helps,

    Scott


    www.develop1.net
    Thursday, August 25, 2011 8:46 AM
    Answerer