web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

flow data purchase header to value entry

(0) ShareShare
ReportReport
Posted on by 125

Hi ,

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

I have the same question (0)
  • Suggested answer
    Nitin Verma Profile Picture
    21,698 Moderator on at

    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.

  • Arepaka Sai Profile Picture
    125 on at

    thank you

  • Suggested answer
    YUN ZHU Profile Picture
    95,309 Super User 2025 Season 2 on at

    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

  • Verified answer
    Arepaka Sai Profile Picture
    125 on at

    thank you

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,175

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 2,476 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,435 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans