Update CRM Entityimage in 3 Easy Steps Using Premium Derived Column

24 November 2016
KingswaySoft Team

The Image field type has been available since CRM 2013 to allow users to display pictures within records in certain entities. This provides a more intuitive way to present records in CRM application. Recently, we have received many emails from our clients asking about how to upload record image during the integration process, so we have decided to write this blog to share our solution.

In this blog, we would like to demonstrate how easy it is to work with the Image field (entityimage) by using our SSIS Productivity Pack and SSIS Integration Toolkit for CRM. Before we start to talk about our solution, let’s take a look at the entityimage field first.

What is entityimage field?

Entityimage is an Image type field that stores image information for records. This field is available for certain system entities and some of them are enabled by default. For custom entities, you would also be able to create this field by yourself and display the image in your CRM application. Please note that in this case, only one image field is allowed per entity.

Below is the list of supported system entities, those marked with an asterisk are enabled by default to show entityimage in CRM (credit from MSDN):

Account *

KbArticle

Campaign

Incident

Competitor *

Connection

Contact *

Contract

TransactionCurrency

EmailServerProfile

Goal

Invoice

Lead *

Mailbox

OpportunityProduct

SalesOrder

Organization

Product *

Publisher *

Queue

Resource *

SalesLiterature

Territory

SystemUser *

Our next question is how to work with this field. In order to update the entityimage field, you will need to supply the binary value of the file content. A widely used component during this step will be the Import Column component.

  • Import Column component: An SSIS out-of-box transformation component that can be used to read data from files and add the data to the data flow buffer. It is capable to perform the job but the inconvenient configuration is always painful for our integration development.

Solution for Updating Entityimage Field

In this section, we will give an example and show you how to use a single function in our Premium Derived Column component to upload images to contact entity as a much easier alternative to the out-of-box functionality in SSIS.

update crm entityimage with ssis premium derived column

As the screenshot shown above, our data flow task is quite straightforward, which includes three components:

  • Flat File component: An out-of-box source component which allows you to read data from your local file system.
  • Premium Derived Column component: A more advanced Derived Column component that offers nearly 200 functionalities and with more to come. In this example, we are going to use one of them, ReadBinaryContent(), under the File I/O Functions catalog.
  • CRM Destination component: One of the featured components that we offered in our SSIS Integration Toolkit for CRM, which has many desirable options to work with Dynamics CRM.

Updating Entityimage Field - Example

1. Prepare the upload list

As you can see from the screenshot below, we are going to upload three images to the corresponding contact records. In this example, we will use a flat file to store the mapping list and supply the contact name as the unique identifier for update action. Please note that it is possible to use either text value or GUID value as the primary key as we offer a Text Lookup feature in our CRM Destination component.

flat file

2. Convert the file content

As we have mentioned, the entityimage field only accepts binary content, so in this step we are going to use the ReadBinaryContent() function to read the image stored in the file system and get the appropriate data to pass to CRM application. This function takes the file path as the input parameter and returns the binary content of the file into the output Column. We simply drag and drop the function to the Expression column.

ssis premium derived column readbinarycontent function

3. Build the mapping

The last step is to build the mapping of related fields and specify the Update action in the CRM Destination component.

CRM SSIS Destination Componet entityimage mapping

  • Map the contactName field to the contactid field;
  • Map the imageContent field to the entityimage field

Notice that we have setup a text lookup on the contactid field as we are passing the name value to this field. You can find more information on how to use the Text Lookup feature here.

Final Results

The image uploading process becomes relatively straightforward with our Premium Derived Column component. Comparing to the Import Column component, we offer:

  • Friendly user interface with simple drag and drop experience;
  • Build-in function that you could utilize right away.

There are also more easy-to-use and high-performance SSIS components in the SSIS Productivity Pack for you to discover and you will realize how this premium pack could help you achieve your integration goal in a more productive way.

Sample SSIS Package

A sample SSIS package is available for download here. The sample package was prepared in a SQL Server 2008 R2 format, and it should automatically upgrade if you are using any newer version of SSIS.

Archive

November 2024 3 October 2024 1 September 2024 1 August 2024 2 July 2024 1 June 2024 1 May 2024 1 April 2024 2 March 2024 2 February 2024 2 January 2024 2 December 2023 1 November 2023 1 October 2023 2 August 2023 1 July 2023 2 June 2023 1 May 2023 2 April 2023 1 March 2023 1 February 2023 1 January 2023 2 December 2022 1 November 2022 2 October 2022 2 September 2022 2 August 2022 2 July 2022 3 June 2022 2 May 2022 2 April 2022 3 March 2022 2 February 2022 1 January 2022 2 December 2021 1 October 2021 1 September 2021 2 August 2021 2 July 2021 2 June 2021 1 May 2021 1 April 2021 2 March 2021 2 February 2021 2 January 2021 2 December 2020 2 November 2020 4 October 2020 1 September 2020 3 August 2020 2 July 2020 1 June 2020 2 May 2020 1 April 2020 1 March 2020 1 February 2020 1 January 2020 1 December 2019 1 November 2019 1 October 2019 1 May 2019 1 February 2019 1 December 2018 2 November 2018 1 October 2018 4 September 2018 1 August 2018 1 July 2018 1 June 2018 3 April 2018 3 March 2018 3 February 2018 3 January 2018 2 December 2017 1 April 2017 1 March 2017 7 December 2016 1 November 2016 2 October 2016 1 September 2016 4 August 2016 1 June 2016 1 May 2016 3 April 2016 1 August 2015 1 April 2015 10 August 2014 1 July 2014 1 June 2014 2 May 2014 2 February 2014 1 January 2014 2 October 2013 1 September 2013 2 August 2013 2 June 2013 5 May 2013 2 March 2013 1 February 2013 1 January 2013 1 December 2012 2 November 2012 2 September 2012 2 July 2012 1 May 2012 3 April 2012 2 March 2012 2 January 2012 1

Tags