Skip to main content

Notifications

Microsoft Dynamics NAV (Archived)

Table field not auto updated

Posted on by Microsoft Employee

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

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Table field not auto updated

    Thanks RockWith NAV.

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

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Table field not auto updated

    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.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Table field not auto updated

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

    Vend.get(vendorno);

    before getting the vendor name and vendor invoice term.

  • Suggested answer
    RockwithNav Profile Picture
    RockwithNav 6,562 on at
    RE: Table field not auto updated

    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.

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: Table field not auto updated

    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
    RobertasR Profile Picture
    RobertasR 5,002 on at
    RE: Table field not auto updated

    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

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Table field not auto updated

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

  • Suggested answer
    Amol Salvi Profile Picture
    Amol Salvi 18,694 on at
    RE: Table field not auto updated

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

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans