Skip to Content

How to send mail with standard document as an attachment?

Apr 24, 2017 at 01:20 PM


avatar image

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.


Sankaran A

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Horst Schaude
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.

. Horst

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Dear Horst,

Thank you so much for your response.

I able to send a mail with attachment.

But I need to know what is the FormTemplateCode for standard Confirmation Sales Order Form.

I have to send a mail with standard form document.

FormTemplateCode.content ="What is the form template code for Confirmation SO Form template";

I tried above code. But it is returning empty PDF. Is there any issue?




Hello Sankara,

Acc. to my system "C0001" is the code for the "Sales Order Confirmation".

So I am sorry, but you need to raise an incident for this.

. Horst