Retrieve EntityImage url in mscrm 2013
First you need to get the service object
to get service object follow the below link:
http://raju2565.blogspot.in/2014/07/mscrm-online-authentication.html
Entity _account = new Entity("account");
//Retrieve and the records with just the url
string imageUrlQuery = String.Format(@"<fetch mapping='logical'>
<entity name='{0}'>
<attribute name='sample_name' />
<attribute name='entityimage_url' />
</entity>
</fetch>", _account);
EntityCollection imageUrlResults = service.RetrieveMultiple(new FetchExpression(imageUrlQuery));
Console.WriteLine("These are the relative URLs for the images retrieved:");
foreach (Entity record in imageUrlResults.Entities)
{
String imageUrl = record["entityimage_url"] as String;
Console.WriteLine(imageUrl);
}
to get service object follow the below link:
http://raju2565.blogspot.in/2014/07/mscrm-online-authentication.html
Entity _account = new Entity("account");
//Retrieve and the records with just the url
string imageUrlQuery = String.Format(@"<fetch mapping='logical'>
<entity name='{0}'>
<attribute name='sample_name' />
<attribute name='entityimage_url' />
</entity>
</fetch>", _account);
EntityCollection imageUrlResults = service.RetrieveMultiple(new FetchExpression(imageUrlQuery));
Console.WriteLine("These are the relative URLs for the images retrieved:");
foreach (Entity record in imageUrlResults.Entities)
{
String imageUrl = record["entityimage_url"] as String;
Console.WriteLine(imageUrl);
}
Comments
Post a Comment