Skip to Content
author's profile photo Former Member
Former Member

Add text line to Draft

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 16, 2008 at 10:53 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 16, 2008 at 02:10 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.