Discussions
Activity
Best Of...
Sign In
·
Register
Home
›
NAV Three Tier
Howdy, Stranger!
It looks like you're new here. Sign in or register to get started.
Sign In
Register
Quick Links
Categories
Recent Discussions
Activity
Best Of...
Unanswered
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
115
Navision DOS
854
Navision e-Commerce
1K
NAV Tips & Tricks
772
NAV Dutch speaking only
615
NAV Courses, Exams & Certification
2K
Microsoft Dynamics-Other
1.5K
Dynamics AX
302
Dynamics CRM
109
Dynamics GP
10
Dynamics SL
1.5K
Other
993
SQL General
384
SQL Performance
34
SQL Tips & Tricks
34
Design Patterns (General & Best Practices)
Architectural Patterns
10
Design Patterns
5
Implementation Patterns
53
3rd Party Products, Services & Events
1.7K
General
1.1K
General Chat
1.6K
Website
79
Testing
1.2K
Download section
23
How Tos section
260
Feedback
12
NAV TechDays 2013 Sessions
13
NAV TechDays 2012 Sessions
Attach multiple files - Send to Email - Business Central
rsrnav
Member
Posts:
6
2020-02-26
in
NAV Three Tier
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?
0
Answers
TallyHo
Member
Posts:
415
2020-02-27
edited 2020-02-27
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
rsrnav
Member
Posts:
6
2020-02-27
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
Sign In
or
Register
to comment.
Answers
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;
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?