Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

Need information about CurrFieldNo

(2) ShareShare
ReportReport
Posted on by 68
When the CurrFieldNo holds the field Number.
 
ex:
I have a field called /A/
one function called in onvalidate trigger
 
function contains this /if/ condition.
 
 
I inserted a record and tried to enter a value in the field /A/ (on business central), onvalidate trigger was triggered and successfully entered into if condition(got the CurrFieldNo).
 
I tried to insert the record from code(Visual studio), performed TableName.validate(/A/,5); but the condition got failed because the CurrFieldNo is getting 0.
 
Please explain when we will get the CurrFieldNo
 
  • Suggested answer
    TeddyH Profile Picture
    TeddyH 12,864 Super User 2024 Season 1 on at
    Need information about CurrFieldNo
    You will only get the CurrFieldNo if you enter a value from UI. 
    If you are using code, the CurrFieldNo will always be zero.
     
    You usually use CurrFieldNo to make sure that the code is only triggered when a user fills in a specific field. It also prevents the same code from running multiple times.
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 75,673 Super User 2024 Season 2 on at
    Need information about CurrFieldNo
    Hi, you can try the following method.
    Dynamics 365 Business Central: How to get the id, type, length and value of a field by its text name (field name)
     
     
    Thanks.
    ZHU
  • gdrenteria Profile Picture
    gdrenteria 12,929 Most Valuable Professional on at

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

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,661 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,379 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans