Announcements
No record found.
Hello All,
I have added a field in vendor table called Status. We want this status field to be updated when any field in vendor table change/modify,
Status is a option field: Authorized, unauthorized.
Can anyone please help,
Thanks Much,
Zoe
Then you should put your code in the OnAfterModify trigger on the Vendor table.
You can use this event subscriber:
learn.microsoft.com/.../devenv-onaftermodifyevent-table-trigger
Hi, like the following?
Hope this helps as well.
Thanks.
ZHU
You can also create the Event subscribe as per below
[EventSubscriber(ObjectType::Table, Database::Vendor, 'OnAfterModifyEvent', '', false, false)]
local procedure OnAfterModifyEventVendor(var Rec: Record Vendor)
begin
Rec.status := Rec.Status::UnAuthorized;
end;
Thanks Everyone. In NAV 2017 where i can create event subscription?
Hi,
You can go to codeunit and create a function and on the function property give the below details, and then inside that function you can write your own code.
Hi, If it's NAV 2017, you first need to have a development license.Then open Development Environment, find Table 23 Vendor, right click and select Design.
Then add your code to OnModify Trigger.More details: https://learn.microsoft.com/en-us/dynamics-nav/onmodify-trigger
Hope this helps.
I tried this but it works when we modify/change vendor no. If i change/modify any other field then Status remains same as Authorized.
Didn't you add code to the OnModify Trigger of the No. field? Pull down, you can find the OnModify Trigger of this table, adding to it should solve the problem.
https://learn.microsoft.com/en-us/dynamics-nav/onmodify-trigger
Hello Yun,
Actually My vendor page contain data of two tables i.e. tab-23 and tab-50010(custom). If i write code on OnModify trigger on table 23 then it only works for fields those are related to this table but if i change anything in other field then status doesn't update.
E.g - Address - tab-23- If i change then Status change to Unauthorized
Additional Name-Tab-50009 but added in same vendor card page- Status doesn't change
Appreciate your help.
Thanks,
Hi, I don't know the structure of your new table, but I think this table should be related to the Vendor table. You can use the following methods to update Vendor 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.
Congratulations to our 2026 Super Stars!
Thanks to all of our 2025 Community Spotlight stars!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
OussamaSabbouh 2,161 Super User 2026 Season 1
YUN ZHU 1,046 Super User 2026 Season 1
Dhiren Nagar 932 Super User 2026 Season 1