Skip to content
This repository was archived by the owner on Oct 19, 2026. It is now read-only.
This repository was archived by the owner on Oct 19, 2026. It is now read-only.

[Event Change Request] Codeunit 5900 "Service Header" - OnValidateShipToCodeOnBeforeDeleteLines() #30423

Closed

Description

@auzscr

Why do you need this change?

I need xServiceHeader here to check whether Ship-to Code has been changed when IsHandled is used.

Image

Describe the request

Image

[IntegrationEvent(false, false)]
local procedure OnValidateShipToCodeOnBeforeDeleteLines(var ServiceHeader: Record "Service Header"; var IsHandled: Boolean)
begin
end;

Repalce with:
[IntegrationEvent(false, false)]
local procedure OnValidateShipToCodeOnBeforeDeleteLines(var ServiceHeader: Record "Service Header"; xServiceHeader: Record "Service Header"; var IsHandled: Boolean)
begin
end;
Internal work item: AB#647077

Activity

  1. changed the title [-][Event Change Request] 5900 "Service Header" - OnValidateShipToCodeOnBeforeDeleteLines()[/-] [+][Event Change Request] Codeunit 5900 "Service Header" - OnValidateShipToCodeOnBeforeDeleteLines()[/+] on Aug 15, 2026
  2. added
    missing-infoThe issue misses information that prevents it from completion.
    on Aug 15, 2026
  3. github-actions commented on Aug 15, 2026

    @github-actions
    Contributor

    Hi Steffan Crook (@auzscr),

    Thank you for your extensibility request. To help us process it efficiently, please update the issue to include the required information.

    📚 Extensibility Guidelines

    Missing Information:

    • Previous-record (xServiceHeader) justification: Please explicitly confirm and justify why this event needs an xRec-style previous-record parameter so subscribers can rely on previous-record semantics in this event context.

    Please update the issue with the missing details. We'll automatically re-analyze once updated.

    Note

    Automatically generated by the Triage Agent — advisory only. An engineer will review before any action is taken.

    Tip

    Not accurate? Reply with /not-accurate (optional: add a short explanation). Your feedback improves future responses.

  4. auzscr commented on Aug 17, 2026

    @auzscr
    Author
                    IsHandled := false;
    				//
                    //OnValidateShipToCodeOnBeforeDeleteLines(Rec, IsHandled);
    				OnValidateShipToCodeOnBeforeDeleteLines(Rec, xRec, IsHandled);
    				//
                    if not IsHandled then
                        if ("Ship-to Code" <> xRec."Ship-to Code") and
                           ("Customer No." = xRec."Customer No.") and
                           ServItemLineExists()
                        then begin
                            Modify(true);
                            ServLine.LockTable();
                            ServItemLine.LockTable();
                            ServLine.Reset();
                            ServLine.SetRange("Document Type", "Document Type");
                            ServLine.SetRange("Document No.", "No.");
                            ServLine.DeleteAll(true);
                            ServItemLine.Reset();
                            ServItemLine.SetRange("Document Type", "Document Type");
                            ServItemLine.SetRange("Document No.", "No.");
                            ServItemLine.DeleteAll(true);
                        end;
    

    I have to check value for other custom fields and check if I need to handle the code. Thats why I need the xRec so see if it has changed.

  5. added
    SCMGitHub request for SCM area
    event-requestRequest for adding an event
    and removed
    missing-infoThe issue misses information that prevents it from completion.
    on Aug 17, 2026
  6. github-actions commented on Aug 17, 2026

    @github-actions
    Contributor

    ✅ Analysis complete - ready for further processing


    Implementation:

    Update the OnValidateShipToCodeOnBeforeDeleteLines integration event in Service Header to include xServiceHeader and pass xRec from the caller.

    Location in OnValidate("Ship-to Code") logic:

                    IsHandled := false;
                    OnValidateShipToCodeOnBeforeValidateServiceZoneCode(Rec, IsHandled);
                    if not IsHandled then
                        Validate("Service Zone Code");
    
                    IsHandled := false;
                    OnValidateShipToCodeOnBeforeDeleteLines(Rec, IsHandled, xRec);
                    if not IsHandled then
                        if ("Ship-to Code" <> xRec."Ship-to Code") and
                           ("Customer No." = xRec."Customer No.") and
                           ServItemLineExists()
                        then begin

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

        [IntegrationEvent(false, false)]
        local procedure OnValidateShipToCodeOnBeforeDeleteLines(var ServiceHeader: Record "Service Header"; var IsHandled: Boolean; xServiceHeader: Record "Service Header")
        begin
        end;

    File: ServiceHeader.Table.al

    Note

    Automatically generated by the Triage Agent — advisory only. An engineer will review before any action is taken.

    Tip

    Not accurate? Reply with /not-accurate (optional: add a short explanation). Your feedback improves future responses.

  7. AleksandricMarko commented on Sep 1, 2026

    @AleksandricMarko
    Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    SCMGitHub request for SCM areaevent-requestRequest for adding an eventext-ready-to-implementReviewed and ready to implement and create PR

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions