I was just working on an assignment where I got the need of the customer like they want the Item Picture via web service. Another validation they put in was they don’t want the item picture to be saved on any particular directory instead they want on fly.
So now in standard NAV 2018 Item picture data-set has been changed from Blob to Mediaset so it was then added challenge. We need to convert the picture into streams and bytes and then we can send this over service but how to convert it into bytes. Converting Blob we all are well experienced but what about Mediaset.
There’s a new virtual table which Microsoft has introduced to maintain this identity in Blob which is Tenant Media. The reason why Microsoft did so is now we have the capability to add multiple pictures for an item.
So here is the piece of code how we are suppose to do this.
IF Item.Picture.COUNT = 0 THEN
IF TenantMedia.Content.HASVALUE THEN BEGIN
Return this Picturetext in Web-service and they have to convert it from Base 64 string, they will have the real image.
Item Record Item
TenantMedia Record Tenant Media
TempBlob Record TempBlob