Skip to Content
0
Former Member
Oct 27, 2011 at 06:29 AM

SDK coding to Remove Journal Entry, Journal Voucher

122 Views

Hai,

I have created journal entry.But before creating, I want to check whether journal entry, journal voucher already created for this month. If it is, already created, I want to remove the existing one.

My coding is as follows,

oSBOJournalvouchers = DirectCast(ocompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oJournalVouchers), SAPbobsCOM.JournalVouchers)

Try

oSBOJournalvouchers.JournalEntries.GetByKey(10)

Catch ex As Exception

SBO_Application.MessageBox(ex.Message)

End Try

If oSBOJournalvouchers.JournalEntries.Remove() <> 0 Then

ocompany.GetLastError(errcode, errmsg1)

SBO_Application.MessageBox(errcode & "-" & errmsg1)

End If

oSBOJournalvouchers.JournalEntries.GetByKey(10) --In this line error occurs.

Error Message is:

The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))

Any help is appreciated.

Thanks in Advance.

Thanks,

Parvatha Solai.N