cancel
Showing results for 
Search instead for 
Did you mean: 

Error in creating JE using SDK

Former Member
0 Kudos

I am using B1 2004 B and trying to create JE using SDk(vb6).I am getting the following error:

[OJDT.BtfStatus][line: 2] , 'Row in Transaction with Account No.'

Following is my code:

Dim vJE As SAPbobsCOM.JournalEntries

Set vJE = oCmp.GetBusinessObject(oJournalEntries)

vJE.Lines.AccountCode = "500005"

vJE.Lines.ContraAccount = "131000"

vJE.Lines.Credit = 0

vJE.Lines.Debit = dblAmount

Call vJE.Lines.Add

vJE.Lines.AccountCode = "C003"

vJE.Lines.ContraAccount = "400000"

vJE.Lines.Credit = 0

vJE.Lines.Debit = (dblAmount * 105) / 100

vJE.Add()

B1 gurus please help.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

former_member185703
Active Contributor
0 Kudos

When you encounter a problem when working with DI API, please remember that you should try to do the same in the SAP Business One application!

In your case the first thing which is wrong is that at least one of the account codes in the second line is wrong (AccountCode or ContraAccount); unfortunately the error message does not really tell you that, but this happens quite often in software development.

Secondly the principle of journal entries is to have a "balanced transaction", i.e. <total of Debit(s)> = <total of Credit(s)>... (this will be the next error you will be running into).

I recommend that you check-out the material in the Developer Area on this site (https://www.sdn.sap.com/sdn/developerareas/businessone.sdn?node=linkDnode10) + check-out the SAP Business One-related material in the Education area in the SMB Portal on SAP Service Marketplace (http://service.sap.com/smb)...

HTH,

Frank

Answers (0)