Where does my Item.Picture hide?

SunsetSunset Member Posts: 187
In a BC13 (Build 28871) I have a report written in al/rdlc where I want to include the item picture that is displayed in the item page.
  • First I just just included the Item.Picture in the dataitem column, but for some reason not all the pictures where included.
  • Then I changed the code to repeat through Tenant Media using the Item.Picture.Item(index:Integer) method. This got most of the pictures.
  • Now I have an example of a picture being displayed on the Itempage that is not present in the Tenant Media record; but I have tracked it to the Tenant Media Set record....
So my question is: How can I get the blob value from the Tenant Media Set if there is no corresponding Tenant Media?
Don't just take my word for it, test it yourself

Best Answer

  • SunsetSunset Member Posts: 187
    Accepted Answer
    OK, so I was going about it in the wrong way.
    I was using the GUID from the Picture field to TenantMedia.GET() which coincidently will work in 80-90% of the time.
    However the correct way of doing it is to use the Item.Picture.MediaId to filter the TenantMediaSet.Id, and from there do a loop to try to TenantMedia.GET(TenantMediaSet."Media Id".MediaId)

    Or at least so far that seems to be doing the trick for me.
    Don't just take my word for it, test it yourself

Answers

  • SunsetSunset Member Posts: 187
    Accepted Answer
    OK, so I was going about it in the wrong way.
    I was using the GUID from the Picture field to TenantMedia.GET() which coincidently will work in 80-90% of the time.
    However the correct way of doing it is to use the Item.Picture.MediaId to filter the TenantMediaSet.Id, and from there do a loop to try to TenantMedia.GET(TenantMediaSet."Media Id".MediaId)

    Or at least so far that seems to be doing the trick for me.
    Don't just take my word for it, test it yourself
Sign In or Register to comment.