Skip to main content

Notifications

Announcements

No record found.

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

  • Verified answer
    Avinash B Profile Picture
    Avinash B 1,455 on at
    RE: How to match fields from different tables?

    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

  • InsertX Profile Picture
    InsertX 450 on at
    RE: How to match fields from different tables?

    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
    Avinash B 1,455 on at
    RE: How to match fields from different tables?

    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

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

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

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,436 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans