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 :
Microsoft Dynamics NAV (Archived)

Microsoft Dynamic NAV 2016

(0) ShareShare
ReportReport
Posted on by 793

I add a Trigger to the table cust is a variable Data Type of Record = Table Customer .

i want when the table get the customer No and the Customer Name will auto fill against the Customer No it work properly.


IF cust.GET("Customer No") THEN
BEGIN
"Customer Name":=cust.Name;
END;

Now i want to add this trigger through Codeunite i need help in this trigger using codeunite. please help me with example.

Thanks in advance.

*This post is locked for comments

I have the same question (0)
  • ManishS Profile Picture
    86 on at

    What have you tried can you please share in regards to codeunit.

  • Verified answer
    CDsilva Profile Picture
    4,188 on at

    Hi,

    You'll have to create a function in the codeunit and in the property of the Event set it to Subscriber.

    In the Event Publisher Object property select the table name.

    In the EventFunction property select the trigger e.g OnAfterValidateEvent

    In the EventPublisherElement select the field on validation you want to run your code.

    Hope it helps.

  • Verified answer
    Zaid Tariq Profile Picture
    2,274 on at

    Hi,
    If you are using NAV 2016 or NAV 2017, then you can use the Events. If you want to hook your code with the OnValidate trigger of a field then you need to subscribe to the OnAfterValidate/OnBeforeValidate Trigger of that field.

    For more details about the events have a look at my blog post: http://www.navision360.com/2017/02/getting-started-with-events-in-microsoft-dynamics-nav/

    http://www.navision360.com/2017/02/demo-1-use-custom-table-eventsdatabasetrigger-event-and-subscribe-to-it-nav-2017/

    http://www.navision360.com/2017/02/demo-2-create-custom-event-and-subscribe-to-it-in-microsoft-dynamic-nav-2017/

  • Muhammad Arif Maseed Profile Picture
    793 on at

    Thank you all For Your response kindly response me the above problem with example.

    i will be very thankful to you if kindly contact me on skype = arif_mahsood@outlook.com this is my skype

  • Muhammad Arif Maseed Profile Picture
    793 on at

    sir kindly add me on Skype just need little help from you will be thankful for ever  

  • Verified answer
    Zaid Tariq Profile Picture
    2,274 on at

    Sure

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
TAHER_El_Mehdi Profile Picture

TAHER_El_Mehdi 2

#1
sliderxb Profile Picture

sliderxb 2

#1
broberts Profile Picture

broberts 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans