ALAppExtensions
ALAppExtensions copied to clipboard
[Event Request] Page 6510 - Item Tracking Lines - OnDeleteRecordOnBeforeTempItemTrackLineDelete
Dear Support,
We would like to add a new event OnDeleteRecordOnBeforeTempItemTrackLineDelete in the following trigger using the IsHandled pattern. This would allow us to further customize the code and migrate existing customizations.
trigger OnDeleteRecord(): Boolean
var
TrackingSpec: Record "Tracking Specification";
WMSManagement: Codeunit "WMS Management";
AlreadyDeleted: Boolean;
IsHandled: Boolean; //New Code --++
begin
OnBeforeDeleteRecord(Rec);
TrackingSpec."Item No." := Rec."Item No.";
TrackingSpec."Location Code" := Rec."Location Code";
TrackingSpec."Source Type" := Rec."Source Type";
TrackingSpec."Source Subtype" := Rec."Source Subtype";
WMSManagement.CheckItemTrackingChange(TrackingSpec, Rec);
OnDeleteRecordOnAfterWMSCheckTrackingChange(TrackingSpec, Rec);
//New Code --
IsHandled := false;
OnDeleteRecordOnBeforeTempItemTrackLineDelete(Rec, xRec, DeleteIsBlocked, CurrentSignFactor, SourceQuantityArray[1] < 0, IsHandled);
if not IsHandled then
//New Code ++
if not DeleteIsBlocked then begin
AlreadyDeleted := TempItemTrackLineDelete.Get(Rec."Entry No.");
TempItemTrackLineDelete.TransferFields(Rec);
Rec.Delete(true);
if not AlreadyDeleted then
TempItemTrackLineDelete.Insert();
ItemTrackingDataCollection.UpdateTrackingDataSetWithChange(
TempItemTrackLineDelete, CurrentSignFactor * SourceQuantityArray[1] < 0, CurrentSignFactor, 2);
if TempItemTrackLineInsert.Get(Rec."Entry No.") then
TempItemTrackLineInsert.Delete();
if TempItemTrackLineModify.Get(Rec."Entry No.") then
TempItemTrackLineModify.Delete();
end;
CalculateSums();
exit(false);
end;
Event Signature:
[IntegrationEvent(false, false)]
local procedure OnDeleteRecordOnBeforeTempItemTrackLineDelete(TrackingSpecification: Record "Tracking Specification"; xTrackingSpecification: Record "Tracking Specification"; DeleteIsBlocked: Boolean, CurrentSignFactor: Integer; LineIsDemand: Boolean; var IsHandled: Boolean)
begin
end;
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. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.
Build ID: 10836.