on 10-27-2011 7:29 AM
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
have you put the declaration on the top in the try method as com objects act oddly in VB. net
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I get the same exception, I'm using 8.81 PL08 ... The creation for Journal Voucher success but when I'm trying to update the update failed ... please advice
JournalVouchers voucher = (JournalVouchers)Company.SBO_Company.GetBusinessObject(BoObjectTypes.oJournalVouchers);
voucher.JournalEntries.GetByKey(TransId); // This line make exception The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
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.