External picture storage on Item page

Hi all,

I have been asked to look into whether it’s possible to have the item pictures stored in a folder on the server, rather than in blobs on the item table.

I know I can do this in a report, but is it possible to do this on a page? Where when you open an item card for “item 1”, NAV would then fetch the image from “My server\My File\Item 1.jpg”

Many thanks for any help you can give me.

Regards

Adam.

Adam

Hi! Have you tried the links functionality on the item card?

Neil

Hi Neil,

Thanks for your reply. I have thought of the links function, but the users want to be able to see the picture in a factbox at the side of the screen, so they don’t have to click on anything to see what the item looks like. (Lazy I know!!)

Unless there’s a way of showing the linked image in a factbox? Just to think outside the box.

Many thanks

Adam

Adam,

I am not aware of anything that allows you to do this save a blob. Sorry.

Neil

OK, many thanks.

Hi jones,

You can save external image file path in the item table.And when the Item Card opens you can get the image from the saved path,

you’ll have to write some code for that.

Hi Sriyantha

Thank you. Could you possibly give me an example, or point me in the right direction to where i could see an example please? Many thanks.

Adam.

We did it like this for Form:

InvSetup.“Enable Pictures-Item” <<-boolean added to setup table to turn functionality on & off

InvSetup.“Item Bitmap Path” <<-Text(250) added to setup table to hold the path to the images

OnAfterGetRecord()

SETRANGE(“No.”);

CLEAR(Picture);

InvSetup.GET;

IF InvSetup.“Enable Pictures-Item”

THEN BEGIN

IF EXISTS (InvSetup.“Item Bitmap Path”+“No.”+’.BMP’)

THEN Picture.IMPORT(InvSetup.“Item Bitmap Path”+“No.”+’.BMP’,FALSE);

CALCFIELDS(Picture);

END;

Hi Harry,

Thanks for your reply. Sorry, I should have said originally that we are using 2015, they have removed the IMPORT function, which is very annoying. Do you know of anything else that I can do?

Many thanks

Adam.

  1. Add a new field “Picture Path” to the Item table type of text.

2.Add the field to the Item Card page,I have following globals.

Name DataType Subtype
FileManagement_ Codeunit File Management
FilePath_ Text

go to the OnAssistEdit() trigger of the field “Picture Path”

FilePath_ := FileManagement_.OpenFileDialog(‘Import Picture’,‘Picture1’,‘Text file(.txt)|.txt’);
IF FilePath_ <> ‘’ THEN
“Picture Path” := FilePath_;

Hope this helps.

Hi Sriyantha,

Thank you for that, I can’t test it for a couple of weeks as I’m out of the office, but will do when I get back, many thanks.