Skip to Content

How to send mail with standard document as an attachment?

Hi Everybody,

Scenario: If sales order release, send a mail (Custom development) to the group of people.

Mail Content:

Body: <Content>

Attachment: If you click preview button in a sales order screen, the standard Sales order confirmation form will open. The same pdf need to send as an attachment.

Sample Code:

//Add attachment 2(pdf)
var FormTemplateLanguage = "E";
var PDF : BinaryObject;
var FormTemplateCode : OutputRequestFormTemplateCode;
FormTemplateCode.content = "C0001"; //Code is Form Template Header Code
			
// Reuse Service Call
PDF = OutputManagementUtilities.GetPDF(this, FormTemplateCode,"EN");
if (!PDF.content.IsInitial())
{
  docName = "Sales_Order" ;
  doctype.content = "10001";
  binaryObject = PDF;
  instEmailAttFld.CreateFile(doctype, docName, docAltName, docDesc, binaryObject);
}

The PDF.content will be empty.

How to send a mail with a standard document? Please help me to solve the issue.

Regards

Sankaran A

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Apr 25, 2017 at 12:44 PM

    Hello Sankaran,

    Did you had a look at Allesandro's post ?

    In the lower part Christine asked a question about adding PDFs to the e-mail.

    HTH,
    . Horst

    Add comment
    10|10000 characters needed characters exceeded