Skip to content

Event Request - codeunit 99000858 "Mfg. Get Demand To Reserve" - OnSyncProdOrderComponentsOnBeforeInsertReservationWkshLine #30265

@JeremyOrgan-DC

Description

@JeremyOrgan-DC

Why do you need this change?

This will allow us to change the logic that decides whether the worksheet line should be inserted or not. We would like it to take into account other demand available to reserve such as Purchase or Production Order Output.
I have based it on the same event as in codeunit 99000839 "Sales Get Demand To Reserve"
Existing alternatives evaluated: There are no other ways to control if the worksheet lines get inserted or not.
Justification for bypass control: This copies the design already done for other functional areas such as sales for the reservation worksheet
Performance considerations: This should not cause performance issues
Data sensitivity review: No sensitive data exposed
Multi-extension interaction: Copied existing design for other areas, The way it should be used needs an understanding of the functionality and why we are needing to change the current value of DoInsertReservationWkshLine.

Describe the request

codeunit 99000858 "Mfg. Get Demand To Reserve"
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Reservation Worksheet Mgt.", 'OnCalculateDemandOnAfterSync', '', true, false)]
local procedure SyncProdOrderComponents(BatchName: Code[10]; var GetDemandToReserve: Report "Get Demand To Reserve")
Code at end
.......
if (ReservationWkshLine."Remaining Qty. to Reserve" > 0) and
(ReservationWkshLine."Available Qty. to Reserve" > 0)
then
ReservationWkshLine.Insert(true);
...... Change to
var
DoInsertReservationWkshLine: Boolean;
code
DoInsertReservationWkshLine := (ReservationWkshLine."Remaining Qty. to Reserve" > 0) and (ReservationWkshLine."Available Qty. to Reserve" > 0);
OnSyncProdOrderComponentsOnBeforeInsertReservationWkshLine(ReservationWkshLine, TempProdOrderComponent, DoInsertReservationWkshLine);
if DoInsertReservationWkshLine then
ReservationWkshLine.Insert(true);
.. New Event
[IntegrationEvent(false, false)]
local procedure OnSyncProdOrderComponentsOnBeforeInsertReservationWkshLine(var ReservationWkshLine: Record "Reservation Wksh. Line"; var TempProdOrderComponent: Record "Prod. Order Component" temporary; var DoInsertReservationWkshLine: Boolean)
begin
end;

Would also be good to have the same pattern applied to codeunit 6485 "Serv. Get Demand To Reserve" - SyncServiceOrderLines, codeunit 99000847 "Job Planning Line Get Demand" - SyncJobPlanningLines, codeunit 929 "Asm. Get Demand To Reserve" - SyncAssemblyOrderLines

Many Thanks
Internal work item: AB#639378

Metadata

Metadata

Assignees

No one assigned

    Labels

    SCMGitHub request for SCM areaevent-requestRequest for adding an event

    Type

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions