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
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
Thanks Drew I got it figured out in the end, thanks for your help
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,
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
I think this old article will help... stackoverflow.com/.../how-to-query-for-image-saved-in-records-annotation-using-javascript-in-crm-onlin
Thanks,
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156