on 03-01-2007 5:39 AM
Hi,
i want to find the baseentry of the current Invoice. I am using the following code:
datasourece = oForm.datasources.dbdatasources.item("inv1")
strBaseEntry = datasource.getValue("BaseEntry",0)
strBaseEntry
always returns a null, even its base is a sales order. i can get it from UI if i make the column visible...but this wouldn't be a solution.
but first of all, why isn't the baseentry getting returned from the datasource?
rgds,
lakshman.
HI lakshman ,
Are you creating the Invoive based on Deliverynote or SalesOrder .
I have given you the following example . This will create the Invoice Based on the DeliveryNote.
vCmp.GetNewObjectCode(OrdCodeStr)
This line will get the basedoc Entry .
'----
' Get the DocNum for the newly added order
Dim OrdCodeStr As String
vCmp.GetNewObjectCode(OrdCodeStr)
Dim oInvoiceDoc As SAPbobsCOM.Documents
oInvoiceDoc = vCmp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices)
' set the business partner code
oInvoiceDoc.CardCode = "Customer1SCID"
' set the documents due date - mandatory
oInvoiceDoc.DocDueDate = Now
oInvoiceDoc.Lines.BaseType = SAPbobsCOM.BoObjectTypes.oDeliveryNotes
oInvoiceDoc.Lines.BaseEntry = CInt(OrdCodeStr)
oInvoiceDoc.Lines.BaseLine = 0
oInvoiceDoc.Lines.TaxCode = "01"
' Add Method
Retval = oInvoiceDoc.Add
'----
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
96 | |
10 | |
9 | |
6 | |
3 | |
3 | |
3 | |
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.