ENTITYSTATE MUST BE SET TO NULL, CREATED (FOR CREATE MESSAGE) OR CHANGED (FOR UPDATE MESSAGE)

Nuestro buen amigo Pablo Peralta nos comparte su artículo:

ENTITYSTATE MUST BE SET TO NULL, CREATED (FOR CREATE MESSAGE) OR CHANGED (FOR UPDATE MESSAGE)

clip_image001

When trying to update an Entity by using LINQ query provider in Dynamics CRM 201 this way:

regardingOpportunity.PriceLevelId = new EntityReference(PriceLevel.EntityLogicalName, rateCard.Id); MyXrmServiceContext.Update(regardingOpportunity);

.. I came across the following exception:

EntityState must be set to null, Created (for Create message) or Changed (for Update message)

Ver más aquí.
Saludos.

Fernando García Loera (Community Program Manager – Latin America Region)

Icono Ferglo 40x116twitter 40x40RSS 40x40facebook 40x116linkedin40x40xbox 40x40

Que es un MVP? / Tips para ser MVP