cancel
Showing results for 
Search instead for 
Did you mean: 

Uploading document attachments

Former Member
0 Kudos

Is it possible to upload a document attachment to a draft, invoice or customer record. For example, we have PDFs that we would like to be able to scan and attach to the Invoice it belongs with. Is this possible either through the API or the Application? If so, how/where is this feature?

Thank you very much.

Rhonda

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Yes, it is possible to add attachments to B1.

I have done this by using Attachments property of Contacts (=Activity) Object that I link to BP & doc.

Check DI API help for

- Contacts Object

- Attachment Object

- Attachment2 Object

Are you just scanning documents manually or would you be interested in a more automatic approach using capture software like www.kofax.com?

HTH

Juha

Former Member
0 Kudos

Thanks Juha for the quick response. I will check it out.

We will be scanning some of the documents and others are ones that we are generating through another application of ours.

Rhonda

Former Member
0 Kudos

Well, I'm on my way. I am getting an error.

"Attachments folder not defined, or Attachments folder has been changed or removed." so I assume I am missing something.

Here is that part of my code.


oActivity.CardCode = txtSAPCode.Text;
oActivity.Attachments.Add();
oActivity.Attachments.Item(0).FileName = "d:\PDFs\" + sQuoteNum + "-" +txtName.Text +".pdf";
nAttach = oActivity.Add();

if (nAttach == 0)
{
lblError.Text =  "Attachment Added";
}
else
{
vCompany.GetLastError( out lErrCode, out sErrMsg ); 
lblError.Text =  "Failed to Add Attachment due to the following error: " + sErrMsg + ".";
}

Anyone have any full examples of doing this?

Thanks,

Rhonda

Former Member
0 Kudos

B1 copies attached files to a folder specified in

Administration - System Initialization - General Settings - Path - Attachments Folder.

If the folder is not specified you get the error you described.

HTH

Juha

Former Member
0 Kudos

Thanks again. Now if only I could the file name correct!

Rhonda

Former Member
0 Kudos

Have you tried using single backslashes instead of double backslashes in file name?

Juha

Former Member
0 Kudos

The double slashes work. I just tried to put the wrong variable in the name so of course that file didn't exist. That was just a silly error on my part. Hence the smiley face.

R

Former Member
0 Kudos

Hi,

Recently had a similar customer that wanted to upload diffrent types of attachments to different businessobjects (BP-masterdata, Item-master data, sales documents and purchase documents). Insted of using activities I created an addon that copies files to the attchment-folder-path. The addon also creates a record in a userdefined table. This record holds a reference to the businessobject,businessobject-key (Either ItemCode,CardCode,DocEntry etc..). When opening a specific businessobject I've added two icons. One for adding new attachments and one for displaying a list of attachments to the current businessobject. If interested in a demo or productsheet send me an email (leif@smbbp.no).

Regards Leif

Former Member
0 Kudos

Now I am getting the following error. Any ideas?

A file with this name already exists. [ATC1.FileName][line: 1] , '
server\d$\folder\folder\myfile.pdf'

This is the folder that I created in Adminstration\System Initialize\General Settings\Path in SAP. Could it be a permissions issue?

Rhonda