I am using IDO extension methods to automate tedious shop floor data collection tasks. I set the Transactional flag and these methods work very well except when there is a validation error in any of the IDO method calls made from within my extension method. Since the internal method call will roll back the transaction when a validation error is encountered, I get a "Transaction was aborted" exception and am unable to read the contents of InfoBar to determine what the validation issue was.
Pseudo Code Example:
Sub MyExtensionMethod(job, qtyComplete, infoBar, success)
Execute IDO Method CreateJobTran(job, qtyComplete, infoBar, success)
If successs continue
Grab material to backflush
Execute IDO Method CreateBFlushLot(job, item, lot, qtyRequired, infoBar, success)
If success continue
Execute IDO Method PostJobTran(job, infoBar, success)
***Exception occurs (Transaction was aborted)
If I was able to read InfoBar after calling PostJobTran, it might read something like "Item xxx is obsolete" or "Operation is complete". However, because this is wrapped in an outter transaction and rollback is called from inside PostJobTran, all I get is a "Transaction was aborted" exception.
Does anyone know a way around this without clearing the Transactional Flag on my IDO method? My interim workaround is to manually pre-validate but it's pretty much impossible to account for every validation in every IDO method call.