Hello everyone,
I am trying to update a custom entity through a plug-in in CRM 4. Since it is a custom entity, I can't retrieve it with the ICrmService Retrieve method, so I tried using DynamicEntity with the help of this article:
http://nishantrana.wordpress.com/2008/10/29/understanding-dynamicentity-in-microsoft-dynamic-crm/
This is my code snippet which creates the DynamicEntity with an existing entity's guid (CustomEntityId), and sets a contact lookup field before update. Unfortunately it returns with "unable to process request", and I wasn't able to find the cause of it. Any help would be appreciated.
DynamicEntity MyEntity = new DynamicEntity("new_myentity"); MyEntity.Properties.Add(new KeyProperty("new_myentityid", new Key(new Guid(CustomEntityId)))); MyEntity.Properties.Add(new LookupProperty("new_contact", new Lookup("contact", ContactId))); _service.Update(MyEntity);