Skip to content

[Event Request] codeunit 22 "Item Jnl.-Post Line" procedure CheckExpirationDate event OnCheckExpirationDateOnAfterCalcSumLot #30352

Description

@kmistrytnp

Why do you need this change?

I would like an additional var parameter called SkipNewExpirationDateCheck added to the OnCheckExpirationDateOnAfterCalcSumLot event, and if this is set to true by the subscriber, to then skip the TestField on the "New Expiration Date" field

Note: As this is an integration event, adding extra parameters is not a breaking change, and existing subscribers will be unaffected

Describe the request

Existing code

OnCheckExpirationDateOnAfterCalcSumLot(SumLot, SignFactor, TempTrackingSpecification);
if (SumOfEntries > 0) and
   ((SumOfEntries <> SumLot) or (TempTrackingSpecification."New Lot No." <> TempTrackingSpecification."Lot No.")
   or (TempTrackingSpecification."New Package No." <> TempTrackingSpecification."Package No."))
then
    TempTrackingSpecification.TestField("New Expiration Date", ExistingExpirationDate);

Amended/Proposed Code

SkipNewExpirationDateCheck := false;
OnCheckExpirationDateOnAfterCalcSumLot(SumLot, SignFactor, TempTrackingSpecification, SkipNewExpirationDateCheck);
if (not SkipNewExpirationDateCheck) and (SumOfEntries > 0) and
   ((SumOfEntries <> SumLot) or (TempTrackingSpecification."New Lot No." <> TempTrackingSpecification."Lot No.")
   or (TempTrackingSpecification."New Package No." <> TempTrackingSpecification."Package No."))
then
    TempTrackingSpecification.TestField("New Expiration Date", ExistingExpirationDate);

Current event signature

[IntegrationEvent(false, false)]
local procedure OnCheckExpirationDateOnAfterCalcSumLot(var SumLot: Decimal; SignFactor: Integer; var TempTrackingSpecification: Record "Tracking Specification" temporary)
begin
end;

Updated event signature

[IntegrationEvent(false, false)]
local procedure OnCheckExpirationDateOnAfterCalcSumLot(var SumLot: Decimal; SignFactor: Integer; var TempTrackingSpecification: Record "Tracking Specification" temporary; var SkipNewExpirationDateCheck: Boolean)
begin
end;

Internal work item: AB#642607

Metadata

Metadata

Assignees

No one assigned

    Labels

    SCMGitHub request for SCM areaevent-requestRequest for adding an eventext-ready-to-implementReviewed and ready to implement and create PR

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions