Hi,
My questions is this. When running report 205 Order Confirmation and selecting File -> Send -> Report by E-Mail, NAV 4.2 does not automatically attach the customer's e-mail address from the customer card. Is there an easy way to accomplish this? I've been trying to debug to see if the option Report by E-Mail fires a function or codeunit in NAV where I could easily attach the e-mail address, but I've been unable to find such a thing. Does this mean that the Report by E-Mail option is in the program core? I suppose I could create my own e-mail function using codeunit 397 Mail, but I would like to use the Report by E-Mail option because that's what the customer is used to using and it would also lessen my workload.
If anybody has any suggestions on this, then I would be grateful.
Cheers!
0
Answers
What is an alternative:
Use the REPORT.SAVEASHTML. With this function, you can save to a temp-directory (for example: ENVIRON('TEMP')), and use the mail codeunit to create a mail and attach the temp file...
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
Good luck and it's always nice that people post their solution when ready .
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
Biggest problem was attaching more than one file. This was necessary because the customer has logo and signature *.bmp files. The solution was to copy the NewMessage function and create an identical one with two more "AttachFile" parameters. Of course, it's also necessary to copy the C/AL code that handles the AttachFile parameter. Also, the *.bmp files must be named pic1.bmp, pic2.bmp, etc. in the order that the report processes the pictures.
The full code looks like this... I hope it can prove useful to someone else.