cancel
Showing results for 
Search instead for 
Did you mean: 

How do I create or copy an attatchment to Sales Delivery usign DI

iNDdM
Participant
0 Kudos

My client has a an issue where when they create a Ar Delivery document Based on a sales Order, the attatchment information that was in the sales order does not get copied to the delivery.

so as of SAP Business one version 8.82 PL 09 this is still the case.

Thinking of giving an addon to manage this BUT, I cannot locate the method to create an attachment  with the SAPbobsCOM.Documents object.

This leaves me with direct insert to SQL but I will not do that given support requirements with SAP.

Any ideas will be appreciated.

Accepted Solutions (1)

Accepted Solutions (1)

pedro_magueija
Active Contributor
0 Kudos

Hi Indika,

The attachments for Documents (AttachmentEntry) is available for 9.0 but not before. There is no real work around for that version, unless you upgrade to v9.0.

You can use the UI API to do it, but this is cumbersome.


Best regards,

Pedro Magueija


View Pedro Magueija's profile on LinkedIn

iNDdM
Participant
0 Kudos

Hi Pedro,

have you tried doing this in V9 ?

I have receivded message from SAP that this cannot be done in Version 9. Could they be wrong ?

I dont have a Version 9 machine yet to test this fucntionality so will need to rely on external informaiton.

Worst case I will need to prepare a pc with V9 and that is too cumbersome at this stage just to tell customer this is possible or not.

pedro_magueija
Active Contributor
0 Kudos

Hi Indika,

Yes in version 9.0 it is possible to add attachments to Documents object. I have built an addon that does just that.

Good luck.


Best regards,

Pedro Magueija


View Pedro Magueija's profile on LinkedIn

edy_simon
Active Contributor
0 Kudos

Hi Indika,

Eventhough the Help Files only mention attachment supporting :  Contacts, ContractTemplates, CustomerEquipmentCards, EmployeeInfo, KnowledgeBaseSolutions, Messages, Message, SalesOpportunities, and ServiceContracts.

Below is my test code which work perfectly fine with Delivery Object.

                SAPbobsCOM.Attachments2 oAtt = (SAPbobsCOM.Attachments2)oC.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oAttachments2);

                if (System.IO.File.Exists("C:\\TestFile.txt"))

                {

                    oAtt.Lines.SourcePath = "C:";

                    oAtt.Lines.FileName = "TestFile";

                    oAtt.Lines.FileExtension = "txt";

                    int iErr = oAtt.Add();

                    int AttEntry = 0;

                    if (iErr == 0)

                    {

                        AttEntry = int.Parse(oC.GetNewObjectKey());

                        SAPbobsCOM.Documents oDLN = (SAPbobsCOM.Documents)oC.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oDeliveryNotes);

                        oDLN.CardCode = "C23900";

                        oDLN.AttachmentEntry = AttEntry;

                        oDLN.Lines.BaseEntry = 362;

                        oDLN.Lines.BaseType = 17;

                        oDLN.Lines.BaseLine = 0;

                        iErr = oDLN.Add();

                        if (iErr != 0) MessageBox.Show(oC.GetLastErrorDescription());

                    }

                }

I'm on Release Version of SBO9 PL4.

Regards
Edy

iNDdM
Participant
0 Kudos

Pedro and Edy thanks very much.

Former Member
0 Kudos

Hi Indika Dekumpitiya,

i got the same your issue then i used Edy code, but it not working to me. i have problem with AttachmentEntry , i used SAP 8.81 PL9. Could you help me ???

Thanks

Nghia Hoang

iNDdM
Participant
0 Kudos

Hi Nghia,

if I am not mistaken - Edy ( and Pedro too) said the soultion works o Business One Version 9.0 PL04.

Not 8.82.

Answers (0)