[Event Request] Codeunit 1101 - CA Jnl.-Check Line - RunCheck
Could you please create an Integration event in Codeunit 1101 - CA Jnl.-Check Line, in function RunCheck?
[External] RunCheck(VAR CostJnlLine : Record "Cost Journal Line")
WITH CostJnlLine DO BEGIN
....
// >>>>
IsHandled := FALSE;
OnRunCheckOnBeforeDateNotAllowed(CostJnlLine,IsHandled);
IF NOT IsHandled THEN
// <<<<
IF GenJnlCheckLine.DateNotAllowed("Posting Date") THEN
FIELDERROR("Posting Date",Text005);
....
END;
Event signature:
LOCAL [IntegrationEvent] OnRunCheckOnBeforeDateNotAllowed(VAR CostJnlLine : Record "Cost Journal Line";VAR IsHandled : Boolean)
We need this in our product to set the allowed posting date specifically for Cost Accounting.
We already have this possibility here procedure DateNotAllowed(PostingDate: Date): Boolean var SetupRecordID: RecordID; begin exit(IsDateNotAllowed(PostingDate, SetupRecordID)); end;
procedure IsDateNotAllowed(PostingDate: Date; var SetupRecordID: RecordID) DateIsNotAllowed: Boolean
var
UserSetupManagement: Codeunit "User Setup Management";
begin
DateIsNotAllowed := not UserSetupManagement.IsPostingDateValidWithSetup(PostingDate, SetupRecordID);
OnAfterDateNoAllowed(PostingDate, DateIsNotAllowed);
exit(DateIsNotAllowed);
end;
In that existing event we cannot tell which journal is being posted (General or Cost Journal). We would like to set the allowed posting date specifically for Cost Accounting. Could you please check again? Thank you!
Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. We will update this issue with information about availability.
Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. We will update this issue with information about availability.