Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
264 views2 pages

SAP B1: Email Attachments Guide

The document discusses how to send an email with an attachment in SAP Business One using both the Message Object and Message Service. It explains that attachments are represented by the Attachments2 object and must be copied to the attachments folder defined in administration settings. The Message Object and old way of adding attachments is demonstrated, as well as using Message Services which is the recommended modern approach.

Uploaded by

satishdoke
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
264 views2 pages

SAP B1: Email Attachments Guide

The document discusses how to send an email with an attachment in SAP Business One using both the Message Object and Message Service. It explains that attachments are represented by the Attachments2 object and must be copied to the attachments folder defined in administration settings. The Message Object and old way of adding attachments is demonstrated, as well as using Message Services which is the recommended modern approach.

Uploaded by

satishdoke
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

In this blog we will demonstrate how to send an email with an attachment using both the Message Object and

Message Service. Attachments are


represented in the SAP Business One DI API from version 2005 via the Attachments2 object. This enables the user to copy files from a source folder to
the Attachments folder.

Ensure first that you define the attachments folder in Administration -> System Initialisation -> General Settings. If this is not done you will receive an
error such as "Source Files does not exist".

The Message Object is the 'old' way of utilising the functionality. To add the attachment to the email we call the Attachments subobject of the
Messages object and provide the location of the file name.

As you know SAP recommends that partners use Services in add-ons. All new functionality will in future be released as a service and not an object. To
send an email using Message Services we first need to add the attachment.

In the path you defined in Administration->System Initialization->General


Setting->Path, every attachment will first be copied to this path. If there is already a file with the same name of the one you are attempting to attach the
SAP Business One DI API will try to copy it first to the default path and will then return an error message that the file name exists.

Once the attachment is added we need to link the attachment/document to the email by setting the AttachmentEntry value. This corresponds to
the AbsoluteEntry of the newly added attachment and in our example this is 2. This is stored in the the table ATC1.
248 Views

You might also like