cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove Journal Voucher by SDK?

0 Kudos
511

Dear All,

I am using SAP B1 9.3 and I was imported JV to system with wrong information and now I really want to delete it back. So is that anyway to remove JV by SDK?

Noted: Here is my code

SAPbobsCOM.JournalVouchers oJV = (SAPbobsCOM.JournalVouchers)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oJournalVouchers);

SAPbobsCOM.JournalEntries je = oJV.JournalEntries;
bool result = je.GetByKey(1);


I was error (Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt) when it runs to je.GetByKey(1)


Please help me...
Thanks

Accepted Solutions (1)

Accepted Solutions (1)

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Tony Soeun,

Unfortunately, Journal Voucher business object does not has any GetByKey() method. SAP Note 2277460 mentions the same issue.

Therefore, you need to delete those Vouchers from the SAP Business One Client itself.

Kind regards,

ANKIT CHAUHAN

SAP Business One Support

Answers (1)

Answers (1)

agustin_marcoscividanes
Active Contributor
0 Kudos

Hi

try to delete from SBO client, and if you can do the SDK should have a method to do too.

Kind regards

Agustín