on 12-12-2008 9:35 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.