web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Vendor page modify

(0) ShareShare
ReportReport
Posted on by 5

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

I have the same question (0)
  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,161 Moderator on at

    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

  • Suggested answer
    YUN ZHU Profile Picture
    97,970 Super User 2026 Season 1 on at

    Hi, like the following?

    pastedimage1680738795743v2.png

    Hope this helps as well.

    Thanks.

    ZHU

  • Nitin Verma Profile Picture
    21,786 Moderator on at

    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;

  • Zoe_200 Profile Picture
    5 on at

    Thanks Everyone. In NAV 2017 where i can create event subscription?

  • Suggested answer
    Nitin Verma Profile Picture
    21,786 Moderator on at

    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.

    pastedimage1680764086341v1.png

  • Suggested answer
    YUN ZHU Profile Picture
    97,970 Super User 2026 Season 1 on at

    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.

    pastedimage1680764081856v1.png

    Then add your code to OnModify Trigger.
    More details: https://learn.microsoft.com/en-us/dynamics-nav/onmodify-trigger

    Hope this helps.

    Thanks.

    ZHU

  • Zoe_200 Profile Picture
    5 on at

    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.

  • Suggested answer
    YUN ZHU Profile Picture
    97,970 Super User 2026 Season 1 on at

    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

    Thanks.

    ZHU

  • Zoe_200 Profile Picture
    5 on at

    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,

    Zoe

  • Suggested answer
    YUN ZHU Profile Picture
    97,970 Super User 2026 Season 1 on at

    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.

    pastedimage1680823686951v2.png

    Hope this helps.

    Thanks.

    ZHU

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,161 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,046 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 932 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans