Posts

Showing posts with the label Dynamic Entity

Updating Retrieved Custom Entity Records

The update procedure for Dynamic Entities works well for updating custom entities. However, consider a scenario where you retrieve typecasted records of a custom entity meeting a certain criteria. If you wish to update certain information in these records, using DynamicEntity will throw a type cast error (as the service.retrieve function will return you not a DynamicEntity type but a custom entity type, since the entity for the query is specified by you). The resolution for this is to use the TargetUpdateCustomEntity class for the update. For example, if you wish to retrieve “prospects” in the city “Redmond” and associate them with a certain “project”, you can use “TargetUpdateProspectsRequest” for the operation. ColumnSet cols = new ColumnSet(); // Sets the ColumnSet's Properties cols.Attributes = new string[] { "projectid" }; // Create the ConditionExpression ConditionExpression condition = new ConditionExpression(); // Set the Condition for the Retrieval to get the P...