Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV forum
Answered

flow data purchase header to value entry

Posted on by 125

Hi ,

 how to flow the data from purchase header to value entry using vs code in Business Central?

Categories:
  • Verified answer
    Arepaka Sai Profile Picture
    Arepaka Sai 125 on at
    RE: flow data purchase header to value entry

    thank you

  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 69,760 Super User 2024 Season 2 on at
    RE: flow data purchase header to value entry

    Hi, please try the following.

    pastedimage1651457546570v1.png

    pastedimage1651457564642v2.png

    pastedimage1651457581213v3.png

    tableextension 50133 PurchaseHeaderExt extends "Purchase Header"
    {
        fields
        {
            field(50100; ZYTest; Text[100])
            {
                Caption = 'ZY Test';
                DataClassification = CustomerContent;
            }
        }
    }
    
    pageextension 50133 PurchaseOrderExt extends "Purchase Order"
    {
        layout
        {
            addafter(Status)
            {
                field(ZYTest; Rec.ZYTest)
                {
                    ApplicationArea = All;
                }
            }
        }
    }
    
    tableextension 50134 ItemJournalLineExt extends "Item Journal Line"
    {
        fields
        {
            field(50100; ZYTest; Text[100])
            {
                Caption = 'ZY Test';
                DataClassification = CustomerContent;
            }
        }
    }
    
    tableextension 50135 ValueEntry extends "Value Entry"
    {
        fields
        {
            field(50100; ZYTest; Text[100])
            {
                Caption = 'ZY Test';
                DataClassification = CustomerContent;
            }
        }
    }
    
    pageextension 50135 ValueEntries extends "Value Entries"
    {
        layout
        {
            addafter("Document No.")
            {
                field(ZYTest; Rec.ZYTest)
                {
                    ApplicationArea = All;
                }
            }
        }
    }
    
    codeunit 50134 FlowDatatoValueEntry
    {
    
        [EventSubscriber(ObjectType::Table, Database::"Item Journal Line", 'OnAfterCopyItemJnlLineFromPurchHeader', '', false, false)]
        local procedure OnAfterCopyItemJnlLineFromPurchHeader(var ItemJnlLine: Record "Item Journal Line"; PurchHeader: Record "Purchase Header");
        begin
            ItemJnlLine.ZYTest := PurchHeader.ZYTest;
        end;
    
        [EventSubscriber(ObjectType::Codeunit, Codeunit::"Item Jnl.-Post Line", 'OnBeforeInsertValueEntry', '', false, false)]
        local procedure OnBeforeInsertValueEntry(var ValueEntry: Record "Value Entry"; ItemJournalLine: Record "Item Journal Line"; var ItemLedgerEntry: Record "Item Ledger Entry"; var ValueEntryNo: Integer; var InventoryPostingToGL: Codeunit "Inventory Posting To G/L"; CalledFromAdjustment: Boolean; var OldItemLedgEntry: Record "Item Ledger Entry"; var Item: Record Item; TransferItem: Boolean; var GlobalValueEntry: Record "Value Entry");
        begin
            ValueEntry.ZYTest := ItemJournalLine.ZYTest;
        end;
    
    
    }

    Thanks.

    ZHU

  • Arepaka Sai Profile Picture
    Arepaka Sai 125 on at
    RE: flow data purchase header to value entry

    thank you

  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,023 Moderator on at
    RE: flow data purchase header to value entry

    Hi Arepaka Sai ,

    Not sure what is the requirement but you can use Codeunit 22, check what are the events available to transfer data from Purchase Line to Value entry when you do post any receipt. In the same way you can try to use those events and send data from Purchase header to Value entry.

    Thanks.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,537 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,520 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans