web
You’re offline. This is a read only version of the page.
close
Skip to main content
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
    RE: Retrieve a List of Images from a related Entity.

    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
    RE: Retrieve a List of Images from a related Entity.

    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
    RE: Retrieve a List of Images from a related Entity.

    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
    RE: Retrieve a List of Images from a related Entity.

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

  • Suggested answer
    Mahendar Pal Profile Picture
    45,095 on at
    RE: Retrieve a List of Images from a related Entity.

    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Community Member Profile Picture

Community Member 2

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
UllrSki Profile Picture

UllrSki 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans