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

Community site session details

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

relationships fields between tables in business central

(0) ShareShare
ReportReport
Posted on by 357

Hi community,

Could you help me, how I can populated 1 : N Relationships?

For example I have a field in sales quote (Quote name), and I want after created the order populate the same data in sales order field (Order name)

pastedimage1670348193758v1.png

Thanks

I have the same question (0)
  • Suggested answer
    Amit Profile Picture
    2,557 on at
    RE: relationships fields between tables in business central

    Hi,

    use this event for achieving the functionality.

    OnBeforeInsertSalesOrderHeader(SalesOrderHeader, SalesHeader);
    and for use of Eventscriber. Refer the below link
    Regards
    Amit Sharma
  • Suggested answer
    YUN ZHU Profile Picture
    95,307 Super User 2025 Season 2 on at
    RE: relationships fields between tables in business central

    Hi, If you want to transfer the data on Sales Quote to Sales Order when creating Order. Please refer to Amit's suggestion. You need to add the code when creating the order.

    If you just associate some data, such as master data. Consider using TableRelationship or Flowfield.

    Hope the following helps.

    https://yzhums.com/22220/

    And

    FlowFields (Sum, Average, Exist, Count, Min, Max, Lookup)

    https://yzhums.com/5802/

    How to create a Lookup, Drop-Down, or Option list (Single and Multi select)

    https://yzhums.com/5985/

    How to enter any value in a TableRelation field (Without validating the table relationship)

    https://yzhums.com/17582/

    Thanks.

    ZHU

  • Suggested answer
    DAnny3211 Profile Picture
    11,397 on at
    RE: relationships fields between tables in business central

    Hi

    you should ask your partner to develop a customisation.
    the part involved is this:

    codeunit 86 "Sales-Quote to Order" - > local procedure CreateSalesHeader -> OnBeforeModifySalesOrderHeader
    pastedimage1670428863948v1.png

    you should latch on to this event

    DAniele

  • Suggested answer
    pankaj.k Profile Picture
    994 on at
    RE: relationships fields between tables in business central

    Hi Manuel Lozada,

    if you want to Transfer your New Field Data form "Sales Quote" to "Sales Order" then you need to Write Code on  (EventSubscriber  OnAfterInsertSalesOrderHeader). Use below code...

    [EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales-Quote to Order", 'OnAfterInsertSalesOrderHeader', '', false, false)]
    local procedure OnAfterInsertSalesOrderHeader(var SalesOrderHeader: Record "Sales Header"; SalesQuoteHeader: Record "Sales Header");
    begin

        SalesOrderHeader.YourField := SalesQuoteHeader.YourField;
        salesorderheader.Modify();
    end; 


    6685.Capture.PNG
    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

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,377

#2
Jainam M. Kothari Profile Picture

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

#3
YUN ZHU Profile Picture

YUN ZHU 1,512 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans