Import attachment in Web Client is not working

Aravindh_Navision
Member Posts: 258
Hi All,
[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.
Restart ->
In Customized Table: Attachment Table, I wrote below function for Import.
Local variable of ImportAttachment function:
Parameter: RecIDToImport (RecordID)
Variable: AttachRecordRef (RecordRef)
I wrote below code in page OnAction..
Global variables:
AttachmentRecLineNo (Integer)
AttachmentRecNameofFile (Text)
AttachMgmt2 (Record) Attachment Table
What is missing and can anybody let me know how to sort it out?
Thanks in advance,
Aarvi.
[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.
Restart ->
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] INIT; "Line No." := "Line No." + 10000; "Primary Key" := RecIDToImport; Filename := FileManagement.BLOBImportWithFilter(TempBlob,Text002,'','*.*|','*.*'); IF Filename = '' THEN EXIT; Attachment := TempBlob.Blob; "Name of the File" := FileManagement.GetFileName(Filename); Extension := '.' + FileManagement.GetExtension(Filename); INSERT; IF Attachment.HASVALUE THEN MESSAGE(Text005,Filename);
I wrote below code in page OnAction..
Global variables:
AttachmentRecLineNo (Integer)
AttachmentRecNameofFile (Text)
AttachMgmt2 (Record) Attachment Table
AttachmentRecRef.OPEN(DATABASE::"Purch. Request Header"); AttachmentRecRef.SETPOSITION(GETPOSITION); AttachmentRecID := AttachmentRecRef.RECORDID; AttachmentRecRef.CLOSE; AttachmentManagement.ImportAttachment(AttachmentRecID); AttachmentManagement."Document No." := "No."; AttachmentManagement.MODIFY;
What is missing and can anybody let me know how to sort it out?
Thanks in advance,
Aarvi.
0
Comments
-
It is been solved.
Just modified the line..Filename := FileManagement.BLOBImportWithFilter(TempBlob,Text002,'','*.*|','*.*');
with..Filename := FileManagement.BLOBImportWithFilter(TempBlob,Text002,'','All Files (*.*)|*.*','*.*');
Thanks.1 -
Hi @Aravindh_Navision , Do you have any idea about multiple file upload using the same this file mgt. functionality. Thanks0
-
Hi Shyam,
Sorry for the late reply. I do not have any idea as of now. But let me check and let you know.
Thanks.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions