web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Retrieve a List of Images from a related Entity.

(0) ShareShare
ReportReport
Posted on by

Hi there, I need some help putting together an odata query in my javascript using REST, to get some related image data.

I have an entity named Cast.  I have a second entity named CastImages.

Each CastImage entity has a CastId.

I am writing a webresource that retrieves the list of images for me but I am struggling with the query that I need in CRM.

For a given CastId, I want to retrieve a list of the related images in the related CastImages entities.

So far I have this but I am stuck on how to retrieve the images.

//this is the Cast entity id

var regardingObjectId=window.parent.Xrm.Page.data.entity.getId();     
var entitySchemaName="CastImages";
var odataQuery = "?$select=EntityImageId&" +  
                    "$filter=ObjectId/Id eq guid'" + regardingObjectId;

   //call retrieveMultipleRecords method in SDK.REST javascript script library  
   SDK.REST.retrieveMultipleRecords(entitySchemaName, odataQuery, getPropertyImagesCallback, function (error) { alert(error.message); }, function(){});

How do I also retrieve the image data with this query?  In fact how do I retrieve the Image data at all even just for one EntityImageId?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Drew Poggemann Profile Picture
    4 on at

    I think this old article will help...  stackoverflow.com/.../how-to-query-for-image-saved-in-records-annotation-using-javascript-in-crm-onlin

    Thanks,

  • Community Member Profile Picture
    on at

    Hi Drew and thank you for your reply.  That is retrieving images from a notes field, which I can do, and the solution unfortunately isn't using OData which I require.

    I am using the CRM SDK

  • Verified answer
    Drew Poggemann Profile Picture
    4 on at

    Sorry about that...   The only other resource that looks like it might be helpful is this:  dynamicscrmgirl.wordpress.com/.../crm-2013-javascript-update-an-entity-image-of-a-record-using-odatarest-endpoint-without-jquery

    hopefully this helps...

    Thanks,

  • Community Member Profile Picture
    on at

    Thanks Drew I got it figured out in the end, thanks for your help

  • Suggested answer
    Mahendar Pal Profile Picture
    45,095 on at

    How you are storing your images in CastImages under notes right ?? I hope you can bring that data with your odata query using expend method which allows you to get data from related entity. refer: http://himbap.com/blog/?p=868

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Varsha deshpande Profile Picture

Varsha deshpande 5

#2
JS-09031509-0 Profile Picture

JS-09031509-0 3

#3
Ciprian  P Profile Picture

Ciprian P 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans