cancel
Showing results for 
Search instead for 
Did you mean: 

Obatin BaseEntry of INV1 from Datasource.

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

former_member189387
Active Contributor
0 Kudos

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

'----


Answers (0)