ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

New Subsciber Required in Codeunit 427

Open umang11 opened this issue 6 years ago • 8 comments

I require a new subscriber in codeunit 427 in Function CreateOutboxJnlTransaction with both the variables tempGenJlnLine and OutboxJlnTrasaction before or after insert code.

umang11 avatar Jul 14 '20 05:07 umang11

Subscriber required to flow custom fields to IC Outbox transactions at the end of the function CreateOutboxJnlTransaction with both variables "OutboxJnlTransaction" and "TempGenJnlLine" image

Along with this new subscriber required in function "OutboxJnlLineToInbox" of codeunit 427 "ICInboxOutboxMgt" in the end of the function "OutboxJnlLineToInbox" with access to two variables "ICInboxJnlLine" and "ICOutboxJnlLine" image

please treat this on priority!

@StanPesotskiy

umang11 avatar Jul 14 '20 09:07 umang11

Please always put the full detailed signature of the requested events. If you use AL code copied from VSCode instead of screenshots it will speed up the process of implementation.

StanPesotskiy avatar Jul 14 '20 11:07 StanPesotskiy

Signature details where subscriber is needed codeunit 427 ICInboxOutboxMgt:

procedure CreateOutboxJnlTransaction(TempGenJnlLine: Record "Gen. Journal Line" temporary; Rejection: Boolean): Integer
var
    ICPartner: Record "IC Partner";
    OutboxJnlTransaction: Record "IC Outbox Transaction";
    ICTransactionNo: Integer;
begin
    ICPartner.Get(TempGenJnlLine."IC Partner Code");
    if ICPartner."Inbox Type" = ICPartner."Inbox Type"::"No IC Transfer" then
        exit(0);

    GLSetup.LockTable();
    GetGLSetup;
    if GLSetup."Last IC Transaction No." < 0 then
        GLSetup."Last IC Transaction No." := 0;
    ICTransactionNo := GLSetup."Last IC Transaction No." + 1;
    GLSetup."Last IC Transaction No." := ICTransactionNo;
    GLSetup.Modify();

    with TempGenJnlLine do begin
        OutboxJnlTransaction.Init();
        OutboxJnlTransaction."Transaction No." := ICTransactionNo;
        OutboxJnlTransaction."IC Partner Code" := "IC Partner Code";
        OutboxJnlTransaction."Source Type" := OutboxJnlTransaction."Source Type"::"Journal Line";
        OutboxJnlTransaction."Document Type" := "Document Type";
        OutboxJnlTransaction."Document No." := "Document No.";
        OutboxJnlTransaction."Posting Date" := "Posting Date";
        OutboxJnlTransaction."Document Date" := "Document Date";
        OutboxJnlTransaction."IC Partner G/L Acc. No." := "IC Partner G/L Acc. No.";
        OutboxJnlTransaction."Source Line No." := "Source Line No.";
        if Rejection then
            OutboxJnlTransaction."Transaction Source" := OutboxJnlTransaction."Transaction Source"::"Rejected by Current Company"
        else
            OutboxJnlTransaction."Transaction Source" := OutboxJnlTransaction."Transaction Source"::"Created by Current Company";

OnBeforeInsertICOutboxTransaction(OutboxJnlTransaction,TempGenJnlLine); OutboxJnlTransaction.Insert(); end; OnInsertICOutboxTransaction(OutboxJnlTransaction); exit(ICTransactionNo); end;

[IntegrationEvent(false,false)] local procedure OnBeforeInsertICOutboxTransaction(var OutboxJnlTransaction: Record "IC Outbox Transaction";var TempGenJnlLine: Record "Gen. Journal Line") begin end;

procedure OutboxJnlLineToInbox(var ICInboxTrans: Record "IC Inbox Transaction"; var ICOutboxJnlLine: Record "IC Outbox Jnl. Line"; var ICInboxJnlLine: Record "IC Inbox Jnl. Line") var LocalICPartner: Record "IC Partner"; PartnerICPartner: Record "IC Partner"; begin GetGLSetup; GetCompanyInfo; ICInboxJnlLine."Transaction No." := ICInboxTrans."Transaction No."; ICInboxJnlLine."IC Partner Code" := ICInboxTrans."IC Partner Code"; ICInboxJnlLine."Transaction Source" := ICInboxTrans."Transaction Source"; ICInboxJnlLine."Line No." := ICOutboxJnlLine."Line No.";

    if ICOutboxJnlLine."IC Partner Code" = CompanyInfo."IC Partner Code" then
        LocalICPartner.Get(ICInboxTrans."IC Partner Code")
    else
        LocalICPartner.Get(ICOutboxJnlLine."IC Partner Code");

    if ICOutboxJnlLine."IC Partner Code" = CompanyInfo."IC Partner Code" then
        PartnerICPartner.Get(ICInboxTrans."IC Partner Code")
    else begin
        LocalICPartner.TestField("Inbox Type", LocalICPartner."Inbox Type"::Database);
        PartnerICPartner.ChangeCompany(LocalICPartner."Inbox Details");
        PartnerICPartner.Get(ICInboxJnlLine."IC Partner Code");
    end;

    case ICOutboxJnlLine."Account Type" of
        ICOutboxJnlLine."Account Type"::"G/L Account":
            begin
                ICInboxJnlLine."Account Type" := ICInboxJnlLine."Account Type"::"G/L Account";
                ICInboxJnlLine."Account No." := ICOutboxJnlLine."Account No.";
            end;
        ICOutboxJnlLine."Account Type"::Vendor:
            begin
                ICInboxJnlLine."Account Type" := ICInboxJnlLine."Account Type"::Customer;
                PartnerICPartner.TestField("Customer No.");
                ICInboxJnlLine."Account No." := PartnerICPartner."Customer No.";
            end;
        ICOutboxJnlLine."Account Type"::Customer:
            begin
                ICInboxJnlLine."Account Type" := ICInboxJnlLine."Account Type"::Vendor;
                PartnerICPartner.TestField("Vendor No.");
                ICInboxJnlLine."Account No." := PartnerICPartner."Vendor No.";
            end;
        ICOutboxJnlLine."Account Type"::"IC Partner":
            begin
                ICInboxJnlLine."Account Type" := ICInboxJnlLine."Account Type"::"IC Partner";
                ICInboxJnlLine."Account No." := ICInboxJnlLine."IC Partner Code";
            end;
    end;
    ICInboxJnlLine.Amount := -ICOutboxJnlLine.Amount;
    ICInboxJnlLine.Description := ICOutboxJnlLine.Description;
    ICInboxJnlLine."VAT Amount" := -ICOutboxJnlLine."VAT Amount";
    if ICOutboxJnlLine."Currency Code" = GLSetup."LCY Code" then
        ICInboxJnlLine."Currency Code" := ''
    else
        ICInboxJnlLine."Currency Code" := ICOutboxJnlLine."Currency Code";
    ICInboxJnlLine."Due Date" := ICOutboxJnlLine."Due Date";
    ICInboxJnlLine."Payment Discount %" := ICOutboxJnlLine."Payment Discount %";
    ICInboxJnlLine."Payment Discount Date" := ICOutboxJnlLine."Payment Discount Date";
    ICInboxJnlLine.Quantity := -ICOutboxJnlLine.Quantity;
    ICInboxJnlLine."Document No." := ICOutboxJnlLine."Document No.";
    OnBeforeInsertICInboxJlnLine(ICInboxJnlLine,ICOutboxJnlLine);
    ICInboxJnlLine.Insert();
end;

[IntegrationEvent(false,false)] local procedure OnBeforeInsertICInboxJlnLine(var ICInboxJnlLine: Record "IC Inbox Jnl. Line";var ICOutboxJnlLine: Record "IC Outbox Jnl. Line") begin end;

umang11 avatar Jul 15 '20 04:07 umang11

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.

bc-ghost avatar Jul 18 '20 11:07 bc-ghost

Please share the timeline for this.

as this is very critical for client

umang11 avatar Jul 28 '20 11:07 umang11

It is committed with the build 17.0.14783.0.

StanPesotskiy avatar Jul 28 '20 12:07 StanPesotskiy

What will be the release date of the build 17.0.14783.0.

umang11 avatar Jul 29 '20 05:07 umang11

It should be available in docker image. If you are talking about 16.x, then this event will be shipped with the 16.4 update in August. If you want a hotfix for 16.3 you need to report a bug asking for the downport of this fix.

Please reach out to the relevant support channels as specified in Product Support On premises - https://support.microsoft.com/en-us/supportforbusiness/productselection?sapId=93d37907-ad94-d591-22e9-593cfa09dd3f On line – read more here https://docs.microsoft.com/en-ca/dynamics365/business-central/dev-itpro/administration/manage-technical-support or contact your partner If you are a partner open a support incident through Partner Center - https://partner.microsoft.com/en-us/pcv/dashboard/overview

StanPesotskiy avatar Jul 29 '20 11:07 StanPesotskiy