on 05-04-2005 5:57 AM
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
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
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.