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