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)

Table field not auto updated

(0) ShareShare
ReportReport
Posted on by

Hi NAV Guru,

I have created a custom Option field "Vendor Invoice Term" in Vendor table.

Then I created a custom table which contains Vendor No, Vendor Name and Vendor Invoice Term (Option - exactly same option as the field in Vendor Table). Then I create a page referencing the table so that information can be keyed in from the Page.

In C/AL code, I have a code to auto update the Vendor Invoice Term based on Vendor No.

IF VendNo <> '' THEN BEGIN

 IF VendNo <> Vend."No." THEN BEGIN
   Vend.GET(VendNo);
   VALIDATE("Vendor Name",Vend.Name);
   VALIDATE("Vendor Invoice Term", Vend."Vendor Invoice Term");

END ELSE
   CLEAR(Vend);

END;

The code works in Development environment (with Partner license), however, when I promoted the new table in the client environment, the code doesn't work.

The way I test it, I go into the Page, and then populate the Vendor No, and press enter to see whether the field for Vendor Invoice Term is populated correctly.

Please advise whether additional access needs to be given for the lookup.

Thanks.

Susy

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Amol Salvi Profile Picture
    18,698 on at

    Where you have written the code ? Is it on Vendor No validate ?

  • Community Member Profile Picture
    on at

    I put it on: On Insert(), On Modify(), Vendor No - OnValidate(), Vendor No - OnLookup()

  • Suggested answer
    RobertasR Profile Picture
    5,004 on at

    Hi Susy,

    your code doesn't say how "VendNo" is getting it's value. Could it be the one thing you're missing, something like VendNo := rec."Vendor No."?

    Robertas

  • Suggested answer
    Suresh Kulla Profile Picture
    50,243 Super User 2025 Season 2 on at

    Susy,

    Is the VendNo is the Field Name or a variable you declared locally ? run the debugger on the validate of your vendor no. , I think your If condition is not satifisfied so it is not populating the values.

  • Suggested answer
    RockwithNav Profile Picture
    8,625 Super User 2025 Season 2 on at

    The best answer I can give for now is to first debug your code and cross check Vendor is getting that Vendor No, Preferably if you don't want to debug then simply put a MESSAGE and check what's the value coming in there OR it's not getting.

  • Community Member Profile Picture
    on at

    I thought I assign it when I get vendor by code:

    Vend.get(vendorno);

    before getting the vendor name and vendor invoice term.

  • Community Member Profile Picture
    on at

    Thanks Suresh.

    It was working in Development but not in Client database. So I did another deployment of the custom table and do a replace instead of a merge and it works now.

  • Suggested answer
    Community Member Profile Picture
    on at

    Thanks RockWith NAV.

    It is not assigning, hence I re-deploy the custom table.

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)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans