Skip to content

Misleading - $batch->getLastError() is false even on failure. #545

@chaslain

Description

@chaslain

Hello, I have an issue where, while using batch to add multiple journal entries, no error is indicated from $batch->getLastError() function.

Code:

$batch->Execute();
if ($batch->getLastError())
{
 // my code is not failing on errors!
 throw new Exception("problem!!!");
}

However, After calling execute and enumerating the results (in this case IPPJournalEntry) the Resulting ID Is null, and the accompanying $exception inside the batch is IntuitBatchResponse is populated.

Are batches then not transactional? Can some batch entries succeed while others fail within the same batch?

Proposal
$batch->ExecuteTransactional() which is all or nothing, and populating getLastError() in either case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions