How to use Entity Images in CRM 2013

Gayan Perera, 26 September 2013

Another new feature is CRM 2013 is the ability to set a record specific image. This feature is useful for putting company logos on the account record, a person’s face on a contact record or an image for a product record.

To update the image through the CRM 2013 user interface, simply click on the image and then select a file (less than 5mB) then click upload.

To update the image via the SDK; it is very similar to updating any other attribute/field in CRM. Simply specify the ID of the record you want to update and then set the “entityimage” field to the actual bytes of the file.

 

Entity account = new Entity("account");

account["accountid"] = _testAccountId;
account["entityimage"] = File.ReadAllBytes("c:\path\to\image\file.jpg");

sdk.Update(account);

 

Entity Image data is stored in a new table called EntityDescripter which you can see below.