cancel
Showing results for 
Search instead for 
Did you mean: 

Updating journal entry

Former Member
0 Kudos

Hi all,

I'm using DI API to update a DueDate of a journal entry. But when executing the update method i get the following error:

"-10, Invalid Code [JDT1.ContraAct][line: 1], 'XXXXXXXX'" where XXXXXXXX is an account number.

This is my code:

If (oJournalEntry.GetByKey(iTransId)) Then
  oJournalEntry.DueDate = Today
  If (oJournalEntry.Update <> 0) Then
     vCompany.GetLastError(nErr, sErr)
     ...
  End If
End If

The same update can be made in the SBO Application. By the way, I'm using SBO 2005A SP01 PL3. Haven't tried in SP00.

Thanks in advance,

Ian

Accepted Solutions (1)

Accepted Solutions (1)

Trinidad
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Ian,

Very strange...

I have tried to reproduce your problem in my machine (B1 version in the about window "2005A (6.80.316) SP:01 PL:03") and it works fine...

Are you sure there is nothing special in your Journal entry regarding the accounts?

My code is:

Dim ret As Integer

Dim je As SAPbobsCOM.JournalEntries

je = pCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oJournalEntries)

If (je.GetByKey(76)) Then

je.DueDate = DateTime.Today

ret = je.Update()

If (ret <> 0) Then

MessageBox.Show(pCompany.GetLastErrorDescription())

Return

End If

End If

Where 76 is the number of my last Journal Entry.

???

Regards

Trinidad.

Former Member
0 Kudos

Hi Trinidad,

Thanks for your answer. The only difference between this journal entry and others is that is has been generated by an incoming payment made with a bill of exchange.

I can manually change the DueDate in the B1 application. So I don't know what's happening.

Thanks again Trinidad,

Ian

Answers (0)