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 :
Microsoft Dynamics NAV (Archived)

How to automatically fill the fields on tables in dynamics NAV ERP

(1) ShareShare
ReportReport
Posted on by 165

Hi i would like to know how to automatically fill the fields on Tables in Dynamics NAV ERP.

Ex: i have a table 50001 called "Encomendas" with these fields:

"NoCliente" --> that do a look up to table 18 -> customers.No

"Costumer Name" -> that do a look up to table 18 -> customers.Name

and i want that when i select the costumer number the table automatically fill the field "ClienteNome" by pushing the informtion from table 18 Customer.Name.... Anyone could help me please?

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    It sounds like you created a new table that has some of the same fields as the customer table.

    Therefore, you have created a table relation and a lookup from the New Table to the customer table.  Specifically the Customer Number.

    Now, when you select the customer number from the lookup you also would like to have the customer name get pulled into your new table that also has a field for customer name.

    This can be done a few ways.  First if you do not have Dev license then you can do this using a lookup flowfield to the customer table & name field.

    If you can add code then on validate of the customer no of the new table you can use a GET function to populate fields on your table with values from other tables.

    If Customer.GET(NewTable."No.") then begin

    NewTable.Name := Customer.Name;

    ..more fields if needed

    End;

  • Community Member Profile Picture
    on at

    Hi.

    Sorry for digging this up, but I'm doing a small school project on an older version of Navision, and I've kinda run into the same sort of problem.

    Except that I can't solve it in the same way, because our version of Navision doesn't allow us to add C/AL code to tables.

    So, I'm wondering if I could work around the issue by adding C/AL code to a form, that would be used by my users to fill the table that the form is tied to.

    Thanks in advance.

  • Suggested answer
    Tharanga Chandrasekara Profile Picture
    23,118 on at

    In form you can write codes, but you need to have a developer license to save the changes.

    Define a customer record variable.

    On validate trigger of the forum you can filter the record variable and assign customer name to Rec.Name

    Rec means current record of the form display.

  • Jaideep Sengupta Profile Picture
    430 on at

    There are two ways you can do that but developer license is required.

    1. You can create a flowfield for the customer name in your new table which would have a lookup to the customer table based on the customer no.

    2. Secondly you can write code on the OnValidate() trigger of the client no. field like this

        IF Customer.GET("Client No") THEN

            Client Name := Customer.Name

  • Community Member Profile Picture
    on at

    Thank you very much. Both ofyour suggestions work!

  • Suggested answer
    Community Member Profile Picture
    on at

    Hi Vasco,

    You can do it in very simple way. Just write the code on "OnValidate" trigger of "NoCliente" field like this

    Customer.GET(NoCliente);

    "Customer Name" := Customer.Name;

    Now save and close your table and run and then select the Customer No. Your required information will shown in another field

    Thanks & Regards

    Niraj Kumar

    niraj-msnav.blogspot.com

  • Tharanga Chandrasekara Profile Picture
    23,118 on at

    Glad it helped you. Please be kind enough to verify the answers.

  • Community Member Profile Picture
    on at

    I'm sorry, I thought I had. How do you do that?

  • Suresh Kulla Profile Picture
    50,245 Super User 2025 Season 2 on at

    Marco,

    On the right side of every post it says Did this answer your question?, click yes to the answer which helped you to resolve the issue.

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 > 🔒一 Microsoft Dynamics NAV (Archived)

#1
HoangNam Profile Picture

HoangNam 7

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans