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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

How to match fields from different tables?

(0) ShareShare
ReportReport
Posted on by 450

My goal is to have a field on my customer card and sales order that are the same, so if i enter something in the field on the customer card it will copy the content to sales order once i give in the customer number.

I've created tableextensions for the tables "customer" and "sales header" and added the field in both using the same ID (80005) and i expected them to do what i want to but apparently that isn't the case. I also display them on the pageextension but that's default ofcourse.

Is there something i'm forgetting or just doing wrong? 

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Avinash B Profile Picture
    1,455 on at

    Hi

    The value will be transferred automatically when we use the transfer fields. Since we won't we transfer fields when we enter the Customer No. on Sales Order, the value is not flowing from the Customer record.

    So ideally this can be done by using events.

    Use OnAfterValidateEvent of the field "Sell-to Customer No." from Sales Header and flow the value from customer to sales header.

    Regards

    Avinash B

  • InsertX Profile Picture
    450 on at

    So i retrieved the value from the customer card but the only thing now is somehow i can't set the value of the textbox on my salesorder.

    I tried:

    if Customer.FindFirst() then

         Rec."Information" = Customer."Information";

    but it gives me an error on the line saying that end is expected as well as a semicolon.

    EDIT:

    Nevermind that, i forgot i was supposed to do := instead of =

  • Verified answer
    Avinash B Profile Picture
    1,455 on at

    Hi

    you must use :(Semicolon) to assign the value.

    You can optimize the code like:

    Customer.Get(Rec."Sell-to Customer No.");

    Rec."Information" := Customer."Information";

    Regards

    Avinash B

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans