Skip to content

[Event Request] codeunit 99000808 "PlanningRoutingManagement" OnBeforeSetRtngLineSequenceForward #29607

@dmonteagudo-pwd

Description

@dmonteagudo-pwd

Why do you need this change?

Description

Request to add a specific integration event at the beginning of SetRtngLineSequenceForward
procedure in Planning Routing Management codeunit (ID: 99000808) to enable partners to
implement a critical workaround for a data consistency bug.

This is a follow-up to issue #29512 (OnBeforeSetRtngLineSequenceBack), where the same
underlying issue exists but affects the Forward sequence calculation function.

Context

Describe the request

Current Code (Problematic)

procedure SetRtngLineSequenceForward(
    RoutingType: Option Serial,Parallel; 
    PlanningRtngLine: Record "Planning Routing Line"; 
    MaxSequences: Integer; 
    ActSequences: Integer; 
    TotalCalculation: Boolean)
var
    PlanningRtngLine2: Record "Planning Routing Line";
    SequenceNo: Integer;
begin
    // ❌ MISSING EVENT - Add here
    // OnBeforeSetRtngLineSequenceForward(RoutingType, PlanningRtngLine, MaxSequences, ActSequences, TotalCalculation);

    if RoutingType = RoutingType::Parallel then begin
        if ActSequences > MaxSequences then
            ErrorInRouting(
              PlanningRtngLine."Worksheet Line No.", Text001, ActSequences, MaxSequences);
        // ... rest of procedure

Proposed Solution

Add a new integration event at the beginning of the SetRtngLineSequenceForward procedure:

procedure SetRtngLineSequenceForward(
    RoutingType: Option Serial,Parallel; 
    PlanningRtngLine: Record "Planning Routing Line"; 
    MaxSequences: Integer; 
    ActSequences: Integer; 
    TotalCalculation: Boolean)
var
    PlanningRtngLine2: Record "Planning Routing Line";
    SequenceNo: Integer;
begin
    // ✅ NEW EVENT (follows same pattern as #29512)
    OnBeforeSetRtngLineSequenceForward(RoutingType, PlanningRtngLine, MaxSequences, ActSequences, TotalCalculation);

    if RoutingType = RoutingType::Parallel then begin
        if ActSequences > MaxSequences then
            ErrorInRouting(
              PlanningRtngLine."Worksheet Line No.", Text001, ActSequences, MaxSequences);

Event Publisher (add at the end of the codeunit with other events):

[IntegrationEvent(false, false)]
local procedure OnBeforeSetRtngLineSequenceForward(
    RoutingType: Option Serial,Parallel; 
    var PlanningRtngLine: Record "Planning Routing Line"; 
    MaxSequences: Integer; 
    ActSequences: Integer; 
    TotalCalculation: Boolean)
begin
end;

File: PlanningRoutingManagement.Codeunit.al
Location: Line ~158 (beginning of procedure) + Event definition at end of codeunit

Why This is Needed

  1. Consistency: Issue [Event Request] codeunit 99000808 "PlanningRoutingManagement" OnBeforeSetRtngLineSequenceBack #29512 added OnBeforeSetRtngLineSequenceBack event; this adds the missing twin event for SetRtngLineSequenceForward
  2. Symmetry: Both procedures are called in the same CalculateRouting method and both need the same extensibility
  3. Workaround: Partners need this event to bypass the data consistency bug until the underlying parameter-by-reference issue is fixed in the core product
  4. Manufacturing Impact: Critical for production planning workflows (MRP/MPS calculations)

Business Impact

Additional Information

Related Issues

Internal References

  • Codeunit: 99000808 "Planning Routing Management"
  • Functions: SetRtngLineSequenceForward (line ~158)
  • Related: CalcSequenceForward (calls the function)

Implementation Effort

Internal work item: AB#618980

Metadata

Metadata

Assignees

No one assigned

    Labels

    SCMGitHub request for SCM areaevent-requestRequest for adding an eventships-in-future-updateFix ships in a future update

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions