ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] [Parameter request] CU1011 "Job Jnl.-Check Line" - in procedure OnRunCheckOnBeforeTestFieldJobStatus

Open dennisroczek opened this issue 5 years ago • 3 comments

Procedure OnRunCheckOnBeforeTestFieldJobStatus is a bit useless when having not the Job record as parameter. Please add the Job to the event.

  procedure RunCheck(var JobJnlLine: Record "Job Journal Line")
    var
        Job: Record Job;
        UserSetupManagement: Codeunit "User Setup Management";
        IsHandled: Boolean;
    begin
        OnBeforeRunCheck(JobJnlLine);

        with JobJnlLine do begin
            if EmptyLine then
                exit;

            TestJobJnlLine(JobJnlLine);

            Job.Get("Job No.");
            IsHandled := false;
-----------------------
Before
            OnRunCheckOnBeforeTestFieldJobStatus(IsHandled);
-----------------------
After
            OnRunCheckOnBeforeTestFieldJobStatus(Job, IsHandled);
-----------------------
            if not IsHandled then
                Job.TestField(Status, Job.Status::Open);

dennisroczek avatar Feb 22 '21 12:02 dennisroczek

Wouldn't it be even better to isolate the code block

            Job.Get("Job No.");
            IsHandled := false;
            OnRunCheckOnBeforeTestFieldJobStatus(IsHandled);
            if not IsHandled then
                Job.TestField(Status, Job.Status::Open);

into a separate function called TestJob(JobJnlLine) with a OnBeforeTestJob event with IsHandled?

We have a situation where we want to skip the whole test (the Job doesn't even exist, don't ask...). And a pattern similar to TestJobJnlLine(JobJnlLine) would solve that issue.

ajkauffmann avatar Feb 25 '21 08:02 ajkauffmann

Hi Team,

A confirmation that this request will be approved in the way AJK suggests, is enough for us to continue on removing footprint. Final implementation on version 18 or higher is OK for us.

Thanks in advance!

WJMSmit avatar Mar 09 '21 13:03 WJMSmit

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. 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.

JesperSchulz avatar Mar 22 '21 11:03 JesperSchulz