How to import image into page NAV2013

I don’t know how to import image from my computer into Page of NAV2013

I try to insert some code but it didn’t work


IF EXISTS (‘D:\Work\ABCDE.BMP’) THEN

BEGIN

Rec.Picture.IMPORT(‘D:\Cartoons\ABCDE.BMP’,FALSE);

Rec.CALCFIELDS(Picture);

END;


and when i ran the program it said ‘The IMPORT() method is obsolete. Page View - Company Card must close.’.

so I didn’t know which way to pull them to show up on the Page.

Thank for your help

Chaiyakorn

Welcome to DUG

Do you want to do it via coding only? not manually?

Hello Mohana. Thank you for your reply

Actually I want to learn both of coding and not manually ways. Could you advice to me please. [:)]

Hi Chaiyakorn,

The import/export functions are not supported in NAV 2013. Instead you must use:

CREATEINSTREAM Function (BLOB)
CREATEOUTSTREAM Function (BLOB)

Also you should avoid writing actual code directly in your page object. Instead put the code into a codeunit or keep it as a function in the related table.

it didn’t work. I couldn’t take that picture to show on Page in RTC [:’(]

anyway if it’s possible please teach me at the begin of import image please

P.S. I’m a new of this program so I didn’t know about this program well, please advice me.

You can look at Page 1 - company information

There is a picture box and how it is working…

I still can’t do it,

Now I try to use function UPLOADINTOSTREAM but I didn’t know how to use it well.

P.S. I want to use the image from My Computer, not in NAV 2013 Database so I must use data type BLOB to keep the image file but I can’t find it in data type.

Where did you look?

Did you manage to find a solution?

There are directions on inserting image with NAV 2013.