Skip to Content

How can I add service line item for ARInvoice to SAP B1 using SAPBusinessOneSDK?

Feb 20, 2017 at 03:27 PM


avatar image
Former Member


I'm working on data exportation from our product to SAP Buisness One using SAPBuisnessOneSDK.dll.

I try to export ARInvoice, APInvoice, SalesOrder and PurchaseOrder.

I can fill header fields and ItemLines for these types of documents but I still don't know how to add service items for service table.

Hope you can give me some advice how to insert service lines to service table or probably you can provide some examples of adding new lines to this table.

Waiting for the answer.

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

2 Answers

Best Answer
DIEGO LOTHER Feb 20, 2017 at 04:06 PM

Hi Alex,

If a document will be compose by service or item is a property on Documents object called DocType. After you set up your document for service type, you only need add your services. Below a sample with basically the minimum properties that you need fill.

                Documents oDoc = oCompany.GetBusinessObject(BoObjectTypes.oInvoices);
                oDoc.CardCode = "C00000001";
                oDoc.DocDueDate = DateTime.Now;
                oDoc.DocType = BoDocumentTypes.dDocument_Service;
                oDoc.Lines.ItemDescription = "Test";
                oDoc.Lines.AccountCode = "";
                oDoc.Lines.LineTotal = 100.00;
                if (oDoc.Add() != 0)

Hope it helps.

Kind Regards,

Diego Lother

10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Feb 22, 2017 at 08:54 AM

Thank you. This worked for me.

I must admit that I had to fill TaxCode property like this:

oDoc.Lines.TaxCode = "NY";

Is it possible for the document to have both service and item tables?

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

Hi Alex,

No. The document have only one type service or item.

What you can do is create items with service type and use then with itens of materials type in the documents.

Kind Regards,

Diego Lother

img2.png (15.5 kB)