on 07-24-2009 11:12 AM
Hi!
We try to use DI Server for removing document_lines in A/R Order (documents object).
RemoveObject method for DI Server couldnu2019t be used for documents & document_lines:
u201C Use the RemoveObject command to delete data from the database. This command is supported only for DI objects that support the Remove method (see the DI API documentation)u201D.
How can we delete document_lines using API DI Server?
HI,
try this to delete using di objects
[Visual Basic] The following code sample, demonstrate the use of the Delete method.
Dim oOrder As SAPbobsCOM.Documents ' Order object
Dim lRetCode As Integer ' Return Code
' New Order
oOrder = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders)
' Fill Order details
oOrder.CardCode = "C40000"
oOrder.CardName = "Earthshaker Corporation"
oOrder.HandWritten = SAPbobsCOM.BoYesNoEnum.tNO
oOrder.DocDate = Today()
oOrder.DocDueDate = Today()
oOrder.DocCurrency = "USD"
'Fill 2 lines in the order
oOrder.Lines.ItemCode = "A00001"
oOrder.Lines.ItemDescription = "IBM Inforprint 1312"
oOrder.Lines.Quantity = 1
oOrder.Lines.Price = 380
oOrder.Lines.TaxCode = "0"
oOrder.Lines.LineTotal = 380
oOrder.Lines.Add()
oOrder.Lines.ItemCode = "A00002"
oOrder.Lines.ItemDescription = "IBM Infoprint 1222"
oOrder.Lines.Quantity = 1
oOrder.Lines.Price = 380
oOrder.Lines.TaxCode = "0"
oOrder.Lines.LineTotal = 380
' Now we want to delete the second line in the Order
oOrder.Lines.Delete()
' The Order will be added without the second line
lRetCode = oOrder.Add
Edited by: micheal willis on Jul 24, 2009 4:28 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, Micheal!
Thanks for your answer.
The way you proposed isn't very suitable for us, because it's impossible to use it for great number of connections (it is our programmer's opinion).
We use Interop.SBODI_Server.dll. Intercommunication with SAP Business One is being realized by soap messages:
SBODI_Server.Node DISnode = new SBODI_Server.Node();
string SOAPRequest = u2026
string SOAPResponse = DISnode.Interact(SOAPRequest);
Is it possible to remove document_lines object by soap messages?
Thanks!
| User | Count |
|---|---|
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.