cancel
Showing results for 
Search instead for 
Did you mean: 

Add text line to Draft

Former Member
0 Kudos

I'm creating Draft with:

Dim Draft As SAPbobsCOM.Documents
        Draft = xA.xDef.Societa.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oDrafts)
        Draft.DocObjectCode = SAPbobsCOM.BoObjectTypes.oInvoices
Draft.Lines.ItemCode ="aaa"      
   Draft.Lines.Quantity =1
Draft.Lines.Add()

how I can add a text line? I tryed to set line with

Draft.Lines.LineType = SAPbobsCOM.BoDocLineType.dlt_Alternative

but without result

Regads, Luke

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Luke,

This is only possible in the 2007 version. In order to add a text line you need to use the Special_Lines object as follows:

Sub AddSpecialLine()

        'Adding special line
        'Assume Qut is an existing Quotation Document Object
        Qut.SpecialLines.Add()

        'Setting the type of special line to be sub total
        Qut.SpecialLines.LineType = SAPbobsCOM.BoDocSpecialLineType.dslt_Text

        'Setting the after line number
        'A number that says after which line the special line will appear
        Qut.SpecialLines.AfterLineNumber = 2

        'Check for errors
        lRetCode = Qut.Update()

        If lRetCode <> 0 Then
            oCompany.GetLastError(lErrCode, sErrMsg)
            MsgBox(lErrCode & " " & sErrMsg) ' Display error message
        Else
            MsgBox("Special Lines Added")
        End If

End Sub

There are some restrictions to its use though - Please check the Document_SpecialLines Object section of the 2007 SDK help centre for more information.

Regards,

Niall

Answers (1)

Answers (1)

Former Member
0 Kudos

Thank you! but I'm using 2005 version... so I can't try your solution

I've found only the "brutal" solution of an INSERT query into DRF10.

Regards, Luke

Edited by: Rui Pereira on Dec 23, 2008 4:49 PM