web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

How to Store File like .txt,.pdf in table in NAV 2018

(0) ShareShare
ReportReport
Posted on by 256

Hi, All

I am trying to store it .txt,.pdf file in Item Card. So I Create One Command button to Browse the File using the following Code.

Item.GET('C00001');
SelectedFile := FileMgt.OpenFileDialog('NAV File Browser','*.txt','');
Item.FileText := SelectedFile ;     
Item.MODIFY;
MESSAGE('You selected %1', SelectedFile);

But. I didn't Find out the way how to store the file in Table Field. Because the issue is that if that file is deleted from that location so a user can not find the file. 

So Help me out that Issue.

Thanks in Advance

I have the same question (0)
  • Verified answer
    Suresh Kulla Profile Picture
    50,243 Super User 2025 Season 2 on at

    The way you coded right now get you the file name but if you want to store the actual file then you need to use the Blob field and use the code something like below. By this way, you are storing the actual content

    Check the codeunit 134

    FileName := FileManagement.BLOBImportWithFilter(TempBlob,'Upload File',FileName,STRSUBSTNO(FileDialogTxt,FilterTxt),"*.txt;*.pdf;");
    Item.Content := TempBlob.Blob;

    Item.Modify

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,064

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,568 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,063 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans