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
Thanks RockWith NAV.
It is not assigning, hence I re-deploy the custom table.
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.
I thought I assign it when I get vendor by code:
Vend.get(vendorno);
before getting the vendor name and vendor invoice term.
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.
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.
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
I put it on: On Insert(), On Modify(), Vendor No - OnValidate(), Vendor No - OnLookup()
Where you have written the code ? Is it on Vendor No validate ?
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156