ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] Report 402 "Purchase Document - Test" - Procedure "TestJobFields" - "OnBeforeTestJobFields"

Open StHillmann opened this issue 6 years ago • 2 comments

In order to handle the testfields with our own logic we need a new event raiser and publisher at procedure "TestJobFields" of Report 402 "Purchase Document - Test" with Handled-Pattern.

OLD CODE:

procedure TestJobFields(var PurchLine: Record "Purchase Line")
var
    Job: Record Job;
    JT: Record "Job Task";
begin
    with PurchLine do begin
        if "Job No." = '' then
            exit;

NEW CODE:

procedure TestJobFields(var PurchLine: Record "Purchase Line")
var
    Job: Record Job;
    JT: Record "Job Task";
    // start kvspsa - New Variable added
    IsHandled: Boolean;
    // stop kvspsa
begin
    // start kvspsa - Event Raiser added
    IsHandled := false;
    OnBeforeTestJobFields(PurchLine, IsHandled);
    if IsHandled then
        exit;
    // stop kvspsa
    with PurchLine do begin
        if "Job No." = '' then
            exit;

NEW PUBLISHER:

// start kvspsa - Event Publisher
[IntegrationEvent(false, false)]
local procedure OnBeforeTestJobFields(var PurchLine: Record "Purchase Line"; var IsHandled: Boolean);
begin
end;
// stop kvspsa

StHillmann avatar Mar 25 '20 14:03 StHillmann

I'm sorry about it, but we need to enlarge the event raiser and event publisher by two parameters for handling the error text!

New Event-Raiser: OnBeforeTestJobFields(PurchLine, ErrorCounter, ErrorText, IsHandled);

New Event-Publisher:

// start kvspsa - Event Publisher
[IntegrationEvent(false, false)]
local procedure OnBeforeTestJobFields(var PurchLine: Record "Purchase Line"; var ErrorCounter: Integer; var ErrorText: Array[50] of Text[250]; var IsHandled: Boolean)
begin
end;
// stop kvspsa

StHillmann avatar Mar 26 '20 16:03 StHillmann

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.

bc-ghost avatar Mar 27 '20 13:03 bc-ghost