Tuesday, 10 March 2015

Retrieve EntityImage URL of the record in CRM 2013 and 2015

Entity Image URL

CRM gives us the relative URL of the entity image which can used directly.

Here is the code of it.

string strEntityImageURL = string.Empty;
Entity entObject = objService.Retrieve("contact", new Guid("00000000-0000-0000-0000-000000000000"), new ColumnSet(new string[] { "entityimage_url" }));
if (entObject != null && entObject.Contains("entityimage_url"))
{
    strEntityImageURL = entObject.Attributes["entityimage_url"].ToString();
}

--
Happy CRM'img
Gopinath


 

2 comments:

  1. Hi Ganapath,

    After retrive the Entity Image URL ,then how to update the contact record picture. I tried updating the contact just simply it is replacing the url but actuall it is not updating the existing picture with new picture
    Could you please let me know if anything works for me.
    my contact : babubura@gmail.com

    ReplyDelete
    Replies
    1. Hi,

      follow the below link for updating the image.

      http://mscrmtechie.blogspot.in/2015/06/updating-entityimage-of-crm-record.html

      Delete