ErrorBehaviour attribute cancels CommitBehaviour attribute
1. Describe the bug When a function with the ErrorBehaviour attribute is invoked in a function with the CommitBehaviour attribute, the CommitBehaviour doesnt apply anymore.
2. To Reproduce
Commit throws an error
[CommitBehavior(CommitBehavior::Error)]
local procedure ErrorCommit()
begin
NormalFunction();
Commit();
end;
local procedure NormalFunction()
begin
end;
Commit doesn't throw an error anymore
[CommitBehavior(CommitBehavior::Error)]
local procedure ErrorCommit()
begin
ErrorBehaviorFunction();
Commit();
end;
[ErrorBehavior(ErrorBehavior::Collect)]
local procedure ErrorBehaviorFunction()
begin
end;
3. Expected behavior The commit should throw an error because of the CommitBehaviour attribute.
4. Actual behavior The commit doesn't throw an error.
5. Versions:
- AL Language: 16.3.2065053
- Visual Studio Code: 1.111.0
- Business Central: 27.4
- Operating System: [x] Windows [ ] Linux [ ] MacOS
Great question, I've forwarded it to our runtime experts. It is not part of the issues we normally handle here but I'll leave it open for a bit. Perhaps we can get some clarity on the expected behavior.
Thank you for the bug report, I have identified the root cause, and a fix will be rolled out to all supported versions. (Internal bug ID AB#625959)