cancel
Showing results for 
Search instead for 
Did you mean: 

How to send mail with standard document as an attachment?

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

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

Former Member
0 Kudos

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?

Regards,

Sankaran

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

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.

Bye,
. Horst