[Event Request] [Parameter request] CU1011 "Job Jnl.-Check Line" - in procedure OnRunCheckOnBeforeTestFieldJobStatus
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);
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.
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!
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.