ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] table 11000003 "Detail Line" - OnBeforeCalculateTotalAmountSetCurrentKey

Open alinat2022 opened this issue 4 years ago • 2 comments

Hello,

In GitHub request #16976, it was requested for an event before setting the key:

    local procedure CalculateTotalAmountSetCurrentKey(var DetailLine: Record "Detail Line")
    var
        IsHandled: Boolean;
    begin
        IsHandled := false;
        OnBeforeCalculateTotalAmountSetCurrentKey(DetailLine, IsHandled);  // <<New Event>>>
        if IsHandled then
            exit;

        DetailLine.SetCurrentKey("Account Type", "Serial No. (Entry)");
    end; 

In BC 20.1.39959.0, an event was created after setting the key:

local procedure SetKeyForCalculateTotalAmount(var DetailLine: Record "Detail Line")
begin
    DetailLine.SetCurrentKey("Account Type", "Serial No. (Entry)");
    OnAfterSetKeyForCalculateTotalAmount(DetailLine);
end;

We need the event before setting the key because we need to set a different key, containing more fields then the ones mentioned.

Can you please have a look?

Thank you.

alinat2022 avatar May 09 '22 17:05 alinat2022

You can set whatever key you want using the DetailLine provided by calling SetCurrentKey on it...

Stepanenko-Vadim avatar May 12 '22 14:05 Stepanenko-Vadim

I understand. Thank you.

alinat2022 avatar May 12 '22 16:05 alinat2022