Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

Can I Update Multiple records Using EntityCollection in single call

$
0
0

  I have a requirement to update multiple records in single call, I am using serialized EntityCollection which being provided as input to my code. Now I deserialize this in to EntityCollection Object and call a Update method on it. But Update will not accept EnitityCollecton, only Entity is allowed. Can any one tell me how to handle this.

Following is code snippet.

EntityCollection deserializedContact = null;
dataContractSerializer = new DataContractSerializer(typeof(EntityCollection));
var earlyBoundSerializer = dataContractSerializer;
using (var file = new FileStream(path, FileMode.Open))
{
	deserializedContact = (EntityCollection)earlyBoundSerializer.ReadObject(file);

}

Guid id = new Guid();
XmlDocument createdEntity = new XmlDocument();
string createdEntityXMLPath = string.Empty;
try
{
    if (operation == "UPDATE")
    {
		client.Update(deserializedContact); //This will not accept EntityCollection
    }
}
catch (Exception ex)
{

}


Thanks Regards Prashanth Kamasamudram Even the least work done for others awakens the power within; even thinking the least good of others gradually instills into the heart the strength of a lion.



Viewing all articles
Browse latest Browse all 8223

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>