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...
Answered

How to get a table record inside an OnValidate() trigger?

(0) ShareShare
ReportReport
Posted on by 481

Right now in a Sales Header table extension I have an OnValidate() trigger on one of the fields.
I initialized a Var inside this trigger of type "Record". I've applied a SetRange to get a single row, but trying to access a field on the record via Record.fieldname, results in an empty value.
I've tried using Record.get before the setrange but still no luck

How do I properly get a record in an OnValidate trigger?

I have the same question (0)
  • Verified answer
    YUN ZHU Profile Picture
    98,421 Super User 2026 Season 1 on at

    Hi, It looks like you are missing the Find function.

    A simple Example:

    pastedimage1655164046478v2.png

    pastedimage1655164033015v1.png

    Hope this helps.

    Thanks.

    ZHU

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

    Hi jdrco ,

    Might be you had missed the findfirst after setrange and you are getting empty values, please use Zhu example.

    Thanks.

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 1,857 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,047 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 959 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans