I am trying to import a PDF. This is the code I have for the import. But when I try to compile it, it give me message saying "There is a syntax error"
I cant seem to find error in this code anywhere. Anyone have any ideas or suggestions what might be causing this problem.
PDFExists := "File Data".HASVALUE;
IF "File Data".IMPORT ('*.PDF', TRUE) =' ' THEN BEGIN
MESSAGE (Text005);
EXIT;
END
IF PDFExists THEN
IF NOT CONFIRM (Text001, FALSE) THEN
EXIT;
CurrForm.SAVERECORD;
Any help will be greatly appreciated. Thanks in advance!
0
Comments
NAV Developer
"File Data" is a BLOB in your record?
It is a BLOB. I just have no idea why its not working.
Now when I click on the Import button it open the window where I can select the file I want to import. But when I select the file and click Ok. It doesnt do anything. Any idea whats going on.
How do i change all types from BMP image to PDF (Check out the Screenshot, you will know what i mean). Right now its set ot BMP image. Any Ideas or suggestions?
Screenshot link.
Problem.png - 0.13MB
Based on your selection, only the appropriate file types are shown.
For example, if you select Bitmap, only files with the extension .bmp are shown.
If you select Memo, only files with the extension .txt are shown. I
f you select User-Defined, all files are shown.
http://www.BiloBeauty.com
http://www.autismspeaks.org
How can i display the name of the file that was imported? I am able to get the name and the path of the file. But i only want to display the name.
I tried doing it, the following way, but doing it this way displays the import dialoug box twice. I tried setting the TRUE to FALSE.
"Filename := "File Data".IMPORT ('*.PDF;*.doc;*.docx;*.xls;*.xlxs', FALSE);"
But I get another the following ERROR message: "The file name *.PDF;*.doc;*.docx;*.xls;*.xlxs' contains a character that cannot be used. Check the file name."
Any ideas?
This is what I have so far.
CALCFIELDS ("File Data");
IF "File Data".HASVALUE THEN
FileExists := TRUE;
Filename := "File Data".IMPORT ('*.PDF;*.doc;*.docx;*.xls;*.xlxs', TRUE);
IF "File Data".IMPORT ('*.PDF;*.doc;*.docx;*.xls;*.xlxs', TRUE) ='' THEN
BEGIN
ERROR(Text005)
END;
IF FileExists THEN
IF NOT CONFIRM (Text001, FALSE) THEN
EXIT;
CurrForm.SAVERECORD;