locked
Override custom entity values RRS feed

  • Question

  • Hi,

      I am pretty new to plugin development and any help is appreciated. I have a business usecase where I want to fetch data from an external system and display it in crm. As far as I know I have 2 options to do that :

    1. Create a custom entity and write a post-operation plugin which is triggered on retrieveMultiple of the custom entity. Within the plugin, fetch data from the external system

    2. Using JSONP from the javascript, call the external web service. 

    I have 2 questions,

    # first - Is there a better way to achieve this?

    # If not, I guess to avoid any security issues, I would be using the first approach. Which means, in the plugin I need to fetch data from external system and set that value in the context before returning the response to the UI. Is there a sample code which I can refer to, to achieve this?

    Tuesday, August 28, 2012 3:22 AM

Answers

  • I have decided to build the plugin for this purpose and seems to be working very good so far.
    • Marked as answer by codegenor Saturday, October 13, 2012 2:56 AM
    Saturday, October 13, 2012 2:56 AM

All replies

  • If you don't need to persist the external data in CRM you might want to look into Web Resources. You can embed an HTML page with JavaScript or a SilverLight XAP file into the record and use the id from the record as part of the query to your external data source. You will have more control over the results as opposed to trying to fit data into CRM fields. Another similar approach would be to embed an IFrame in the form, also sending the id of the record to the external page to display related data.

    Jason Lattimer

    Tuesday, August 28, 2012 3:49 AM
    Moderator
  • Thanks for the quick response, I appreciate it. I am using the web resources (my custom html+js+css) to display my custom page. However the data is dynamic and needs to be fetched from my external web service. The approach I am thinking of is to trigger the plugin to get the dynamic data and my custom Web resources will display them. I do not want to store the data in CRM, so I can write a post-operation plugin for retrieveMultiple on the custom entity and inject the values returned from the external web service in the context which will be available to the UI. 
    Tuesday, August 28, 2012 4:43 AM
  • I have decided to build the plugin for this purpose and seems to be working very good so far.
    • Marked as answer by codegenor Saturday, October 13, 2012 2:56 AM
    Saturday, October 13, 2012 2:56 AM