cancel
Showing results for 
Search instead for 
Did you mean: 

[JDT1.Account][line: 1] , 'Tax account has not been defined...'

Former Member
0 Kudos

Hi All,

We're attempting to post a journal and the following code is not working... any ideas? The error is <i>[JDT1.Account][line: 1] , 'Tax account has not been defined for the selected tax code'</i>

oJournal = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oJournalEntries)
oJournal.ReferenceDate = Date.Now
oJournal.DueDate = Date.Now 
oJournal.TaxDate = Date.Now

oJournal.Lines.ShortName = "C1000"
oJournal.Lines.Debit = 114

oJournal.Lines.Add()
oJournal.Lines.AccountCode = "00009000"
oJournal.Lines.Credit = 100

oJournal.Lines.Add()
oJournal.Lines.AccountCode = "00009001"
oJournal.Lines.Credit = 14

If oJournal.Add <> 0 Then
    MessageBox.Show(oCompany.GetLastErrorDescription)
Else
    MessageBox.Show("Added")
End If

Thanks in advance,

Adele

PS: Tested on 2005A SP01 PL09 and PL11

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Solved this issue. You need to remove the ReferenceDate and DueDate and then it posts 100%

Former Member
0 Kudos

Adele,

It's cool how you ask and respond yourself ... hehehe

Happy Hacking !

-

-


Alfredo Pérez

www.corponet.com.mx

SAP Developer & Consultant

alperal (at) gmail.com

+52-(81)-137-937-80

Former Member
0 Kudos

In my case the problem was with the SetCurrentLine method. Here is the code:

-


Set oJE = oSboComp.GetBusinessObjectSAPbobsCOM.BoObjectTypes.oJournalEntries)

oJE.ReferenceDate = DateSerial(2007, 9, 30)

'oJE.Lenes.Add - At the first row do not issue this method!

oJE.Lines.SetCurrentLine 0

oJE.Lines.ShortName = <BP Code>

oJE.Lines.Debit = <Amount>

oJE.Lines.Add 'Now add the 2nd row

oJE.Lines.SetCurrentLine 1

oJE.Lines.AccountCode = <Account Code>

oJE.Lines.Credit = <Amount>

oJE.Add

-


Rgrds,

Jandos