You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ernestasjuska opened this issue
Oct 14, 2024
· 1 comment
Labels
BCIdeaIssue related to a BCIdeaFinanceGitHub request for Finance areaFollow UpThe issue has an open question and must be followed up onLinkedIssue is linked to a Azure Boards work item
The general journal lines are only deleted after posting the batch. But the events from the codeunit Gen. Jnl.-Post Line allow commit before the posting ends. This means after a commit and then an error in the event subscriber, both posted entry and journal line remain in database.
For example, we stumbled upon a rare case when codeunit "CustEntry-Apply Posted Entries" calls codeunit "Payment Tolerance Management" that did a commit and then codeunit "CustEntry-Apply Posted Entries" showed an error.
To reproduce the issue, create a new app with an event subscriber like this:
Posting a payment to customer using payments journal will show error message 'err'. The customer ledger entry will be created even though there was an error.
Please add attribute [CommitBehavior(CommitBehavior::Ignore)] on codeunit Gen. Jnl.-Post Line OnAfterGLFinishPosting event publisher.
Thanks.
Example correction - to demonstrate that it works (it can handle "if codeunit.run then"):
In general, I don't expect commits when using Gen. Jnl.-Post Line. So the attribute could be lifted to procedure Code().
I will provide the implementation for this BC Idea
I will provide the implementation for this BC Idea
codeunit 12 "Gen. Jnl.-Post Line"
{
// ...
[IntegrationEvent(false, false)]
+ [CommitBehavior(CommitBehavior::Ignore)]
local procedure OnAfterGLFinishPosting(GLEntry: Record "G/L Entry"; var GenJnlLine: Record "Gen. Journal Line"; var IsTransactionConsistent: Boolean; FirstTransactionNo: Integer; var GLRegister: Record "G/L Register"; var TempGLEntryBuf: Record "G/L Entry" temporary; var NextEntryNo: Integer; var NextTransactionNo: Integer)
begin
end;
// ...
}
Would you like me to move the issue to the contribution pilot for you?
IMPORTANT: Microsoft is not going to address the reported issue for you. You will have to get the issue approved, and then push a pull request with the suggested changes yourself. If you would like Microsoft to address the issue, please create a support request. Learn more about our support channels here: https://aka.ms/bcsupport.
BCIdeaIssue related to a BCIdeaFinanceGitHub request for Finance areaFollow UpThe issue has an open question and must be followed up onLinkedIssue is linked to a Azure Boards work item
BC Idea Link
https://experience.dynamics.com/ideas/idea/?ideaid=5c4328ef-218a-ef11-9442-6045bdbf4815
Description
Hi,
The general journal lines are only deleted after posting the batch. But the events from the codeunit Gen. Jnl.-Post Line allow commit before the posting ends. This means after a commit and then an error in the event subscriber, both posted entry and journal line remain in database.
For example, we stumbled upon a rare case when codeunit "CustEntry-Apply Posted Entries" calls codeunit "Payment Tolerance Management" that did a commit and then codeunit "CustEntry-Apply Posted Entries" showed an error.
To reproduce the issue, create a new app with an event subscriber like this:
PostingProblemApp.zip
Posting a payment to customer using payments journal will show error message 'err'. The customer ledger entry will be created even though there was an error.
Please add attribute
[CommitBehavior(CommitBehavior::Ignore)]
on codeunit Gen. Jnl.-Post Line OnAfterGLFinishPosting event publisher.Thanks.
Example correction - to demonstrate that it works (it can handle "if codeunit.run then"):
In general, I don't expect commits when using Gen. Jnl.-Post Line. So the attribute could be lifted to
procedure Code()
.I will provide the implementation for this BC Idea
codeunit 12 "Gen. Jnl.-Post Line" { // ... [IntegrationEvent(false, false)] + [CommitBehavior(CommitBehavior::Ignore)] local procedure OnAfterGLFinishPosting(GLEntry: Record "G/L Entry"; var GenJnlLine: Record "Gen. Journal Line"; var IsTransactionConsistent: Boolean; FirstTransactionNo: Integer; var GLRegister: Record "G/L Register"; var TempGLEntryBuf: Record "G/L Entry" temporary; var NextEntryNo: Integer; var NextTransactionNo: Integer) begin end; // ... }
Internal work item: AB#555074
The text was updated successfully, but these errors were encountered: