Cancelling IB Messages via PeopleCode
When incorrect data is uploaded through the excel upload template the IB message will go to error. All subsequent voucher messages will remain in NEW status until the previous message is cancelled. I'd like to automatically cancel the message in error so that it doesn't hold up any other voucher messages. In the VOUCHER_BUILD.VoucherBuild application class, I'm trying to put some error handling to cancel the message.
I.E.
If %IntBroker.Cancel("bd7bd3c8-ee91-11e4-8685-ae275b83c98a", "VOUCHER", %IntBroker_SUB, 0) Then
Warning ("message cancelled!!!");
End-If;
However, when I resubmit the message in IB, I get the below messages. The first error is expected but the other two are related to cancelling the IB message.