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);
        }

Comments

Popular posts from this blog

Connecting Dynamics 365 Web api using external HTML page

Form State Rule using Ribbon Work bench MSCRM 2013

Get azure blob files inside Sub Directories