Hi,
Here is the code for updating the image(entityimage) of CRM record.
public static void UpdateEntityImageOfContact(IOrganizationService iService, Guid guidContact)
{
byte[] byteArray = File.ReadAllBytes(@"CRM_Image.png");
Entity entContact = new Entity("contact");
entContact.Id = guidContact;
entContact.Attributes["entityimage"] = byteArray;
iService.Update(entContact);
}
Contact Record Before Update
Contact Record After Update
Hope this helps
--
Happy CRM'img
Gopinath.
Here is the code for updating the image(entityimage) of CRM record.
public static void UpdateEntityImageOfContact(IOrganizationService iService, Guid guidContact)
{
byte[] byteArray = File.ReadAllBytes(@"CRM_Image.png");
Entity entContact = new Entity("contact");
entContact.Id = guidContact;
entContact.Attributes["entityimage"] = byteArray;
iService.Update(entContact);
}
Contact Record Before Update
Contact Record After Update
Hope this helps
--
Happy CRM'img
Gopinath.
is there any change to get the Image_url directly from one crm instance and update the same picture in some other crm instance ?
ReplyDeleteI have tried to update the same but when i retrieve the image_url and updating the same picture in some other crm instance but simply it is notupdating the picure..Could you please help me regarding the same.
Hi,
DeleteYou need to convert the image to ByteArray and then use the same byte for updating.
You cannot use the URL for updating.