[Version: NAV 2016]
In a customized page, I newly kept an feature for Importing, Exporting and Deleting an attachment. I can able to Import/Export/Delete without any issues in Windows client. When I try to import an attachment from web client, immediately the web page gets closed and am getting below error:An error has occurred
A server error has occurred, and the content cannot be displayed. Refresh the page or open a new browser window.
In Customized Table: Attachment Table, I wrote below function for Import.
Local variable of ImportAttachment function:Parameter: RecIDToImport (RecordID)
Variable: AttachRecordRef (RecordRef)
[b]ImportAttachment(RecIDToImport : RecordID)[/b]
"Line No." := "Line No." + 10000;
"Primary Key" := RecIDToImport;
Filename := FileManagement.BLOBImportWithFilter(TempBlob,Text002,'','*.*|','*.*');
IF Filename = '' THEN
Attachment := TempBlob.Blob;
"Name of the File" := FileManagement.GetFileName(Filename);
Extension := '.' + FileManagement.GetExtension(Filename);
IF Attachment.HASVALUE THEN
I wrote below code in page OnAction..
Global variables:AttachmentRecLineNo (Integer)
AttachMgmt2 (Record) Attachment Table
AttachmentRecRef.OPEN(DATABASE::"Purch. Request Header");
AttachmentRecID := AttachmentRecRef.RECORDID;
AttachmentManagement."Document No." := "No.";
What is missing and can anybody let me know how to sort it out?
Thanks in advance,