
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
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