Attach multiple files - Send to Email - Business Central

rsrnav
Member Posts: 6
I'm using NAV Send Email on Sales Order, now how can we attach mulpile files here.
the files stored in Media Type on Document,
Using File Management BLOBExport function able to download file but needs to attach on mail automatically?
the files stored in Media Type on Document,
Using File Management BLOBExport function able to download file but needs to attach on mail automatically?
0
Answers
-
I use this subscriber to unzip the attachment and add unzipped files before sending. But I guess you can add anything here.
LOCAL [EventSubscriber] C260OnBeforeSendEmail(VAR TempEmailItem : TEMPORARY Record "Email Item";VAR IsFromPostedDoc : Boolean;VAR PostedDocNo : Code[20];VAR HideDialog : Boolean;VAR ReportUsage : Integer)
IF NOT IsFromPostedDoc THEN
EXIT;
IF (UPPERCASE(FileManagement.GetExtension(TempEmailItem."Attachment File Path")) = 'ZIP') THEN BEGIN
FileManagement.ExtractZipFileAndGetFileList(TempEmailItem."Attachment File Path",NameValueBuffer);
NameValueBuffer.SETRANGE(ID,1,7);
IF NameValueBuffer.FINDSET THEN BEGIN
REPEAT
CASE NameValueBuffer.ID OF
1:
BEGIN
TempEmailItem."Attachment File Path" := NameValueBuffer.Name;
TempEmailItem."Attachment Name" := FileManagement.GetFileName(NameValueBuffer.Name);
END;
2:
BEGIN
TempEmailItem."Attachment File Path 2" := NameValueBuffer.Name;
TempEmailItem."Attachment Name 2" := FileManagement.GetFileName(NameValueBuffer.Name);
END;
3:
BEGIN
TempEmailItem."Attachment File Path 3" := NameValueBuffer.Name;
TempEmailItem."Attachment Name 3" := FileManagement.GetFileName(NameValueBuffer.Name);
END;
4:
BEGIN
TempEmailItem."Attachment File Path 4" := NameValueBuffer.Name;
TempEmailItem."Attachment Name 4" := FileManagement.GetFileName(NameValueBuffer.Name);
END;
5:
BEGIN
TempEmailItem."Attachment File Path 5" := NameValueBuffer.Name;
TempEmailItem."Attachment Name 5" := FileManagement.GetFileName(NameValueBuffer.Name);
END;
END;
UNTIL (NameValueBuffer.NEXT <= 0);
END;
END;
0 -
Hi
In my case i have stored file as media in table, i have used the same subscriber ,but how to save this media as file and return file path to use as attachment in email item?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