When you run executeBatch with the transaction attribute set to true,
//...
let requestConfig = new IA.RequestConfig();
requestConfig.transaction = true;
await intacctClient.executeBatch(apiFunctions, requestConfig);
I believe the initial thought with the following code calling ensureStatusNotFailure was that the offending function in the operation would be status=failure and any other proceeding functions status=aborted.
Unfortunately this isn't the case when the request's operation.transaction=true. All functions are returned with status=aborted and the offending function has a result.errors.length > 0. It looks like this is a similar problem on the other SDK's as well.
fixed-sample.js
let requestConfig = new IA.RequestConfig();
requestConfig.transaction = true;
const bufferResponse = await intacctClient.executeBatch(apiFunctions, requestConfig);
for (const result of bufferResponse.results) {
if (result.status !== 'success' && result.errors.length > 0) {
throw new ResultException(
"Result status: " + result.status + " for Control ID: " + result.controlId,
result.errors
);
}
}
When you run executeBatch with the transaction attribute set to true,
I believe the initial thought with the following code calling ensureStatusNotFailure was that the offending function in the operation would be status=failure and any other proceeding functions status=aborted.
https://github.com/Intacct/intacct-sdk-js/blob/bdadac479a3ac6c8b2a34e5429b1ddf3afa740f1/src/Xml/Response/Result.ts#L186-L193
Unfortunately this isn't the case when the request's operation.transaction=true. All functions are returned with status=aborted and the offending function has a result.errors.length > 0. It looks like this is a similar problem on the other SDK's as well.
fixed-sample.js
Sample XML request for Postman
Sample XML response