Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Event Request] Table 36 - OnValidateSellToCustomerNoAfterInit, OnBeforeInitInsert, OnBeforeInitRecord, OnBeforeTestNoSeries #1025

Closed
mbertelsmann opened this issue Jan 31, 2019 · 0 comments
Labels
event-request Request for adding an event ships-in-future-update Fix ships in a future update

Comments

@mbertelsmann
Copy link

Hi,

we need four new events in table 36 Sales Header.

1. event
In trigger "Sell-to Customer No. - OnValidate":

  IF Confirmed THEN BEGIN
    SalesLine.SETRANGE("Document Type","Document Type");
    SalesLine.SETRANGE("Document No.","No.");
    IF "Sell-to Customer No." = '' THEN BEGIN
      IF SalesLine.FINDFIRST THEN
        ERROR(
          Text005,
          FIELDCAPTION("Sell-to Customer No."));
      INIT;
+     // >> START
+     OnValidateSellToCustomerNoAfterInit(Rec,xRec);
+     // << END
      SalesSetup.GET;
      "No. Series" := xRec."No. Series";
      InitRecord;
      InitNoSeries;
      EXIT;
    END;

New publisher function:

    [Integration]
    LOCAL PROCEDURE OnValidateSellToCustomerNoAfterInit@5020302(VAR SalesHeader@5020301 : Record 36;xSalesHeader@5020300 : Record 36);
    BEGIN
    END;

2. event
Function "InitInsert":

    [External]
    PROCEDURE InitInsert@61();
    VAR
+     IsHandled@5020301 : Boolean;
    BEGIN
+     // >> START
+     IsHandled := FALSE;
+     OnBeforeInitInsert(Rec,xRec,IsHandled);
+     IF NOT IsHandled THEN BEGIN
+     // << END
        IF "No." = '' THEN BEGIN
          TestNoSeries;
          NoSeriesMgt.InitSeries(GetNoSeriesCode,xRec."No. Series","Posting Date","No.","No. Series");
        END;
+     // >> START
+     END;
+     // << END

New publisher function:

    [Integration]
    LOCAL PROCEDURE OnBeforeInitInsert@5020313(VAR SalesHeader@5020301 : Record 36;VAR xSalesHeader@5020302 : Record 36;VAR IsHandled@5020300 : Boolean);
    BEGIN
    END;

3. event
Function "InitRecord":

    [External]
    PROCEDURE InitRecord@10();
    VAR
      ArchiveManagement@1000 : Codeunit 5063;
+     IsHandled@5020301 : Boolean;
    BEGIN
      SalesSetup.GET;
+     // >> START
+     IsHandled := FALSE;
+     OnBeforeInitRecord(Rec,IsHandled);
+     IF NOT IsHandled THEN BEGIN
+     // << END
        CASE "Document Type" OF
          "Document Type"::Quote,"Document Type"::Order:
            BEGIN
               ...
            END;
        END;
+     // >> START
+     END;
+     // << END

      IF "Document Type" IN ["Document Type"::Order,"Document Type"::Invoice,"Document Type"::Quote] THEN
        BEGIN
          ...

New publisher function:

    [Integration]
    LOCAL PROCEDURE OnBeforeInitRecord@5020308(VAR SalesHeader@5020300 : Record 36;VAR IsHandled@5020301 : Boolean);
    BEGIN
    END;

4. event
Function "TestNoSeries":

    [External]
    PROCEDURE TestNoSeries@6();
    VAR
+     IsHandled@5020300 : Boolean;
    BEGIN
      SalesSetup.GET;
+     // >> START
+     IsHandled := FALSE;
+     OnBeforeTestNoSeries(Rec,IsHandled);
+     IF NOT IsHandled THEN BEGIN
+     // << END
        CASE "Document Type" OF
          ...
        END;
+     // >> START
+     END;
+     // << END
      OnAfterTestNoSeries(Rec);
    END;

New publisher function:

    [Integration]
    LOCAL PROCEDURE OnBeforeTestNoSeries@5020317(VAR SalesHeader@5020301 : Record 36;VAR IsHandled@5020300 : Boolean);
    BEGIN
    END;

@JesperSchulz JesperSchulz added the event-request Request for adding an event label Feb 4, 2019
@jobulsin jobulsin added the ships-in-future-update Fix ships in a future update label Feb 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
event-request Request for adding an event ships-in-future-update Fix ships in a future update
Projects
None yet
Development

No branches or pull requests

3 participants