Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

custom code in 'No. - OnValidate()' method of the No. field of 'Job Ledger Entry' table (169) not executing

(0) ShareShare
ReportReport
Posted on by 985

Hi,

I have a custom field on the 'Job Ledger Entry' table which I call ResourceType and I I intend to be populating it with values based on the 'Type' value during new record.

I have tested the custom code to do this on the 'No. - OnValidate()',  method of the No. field, 'OnInsert' method of the table but I found out that entries get posted to the table without that code being executed thereby inserting the default value into my ResourceType field.

My question is: Where do I need to place my code so that it can get executed anytime a new record is coming into the table. the new record could be coming from Journal Posting or any other area of the Nav application.

I'll appreciate your advice.

*This post is locked for comments

  • Toffsam Profile Picture
    Toffsam 985 on at
    RE: custom code in 'No. - OnValidate()' method of the No. field of 'Job Ledger Entry' table (169) not executing

    Thanks alot Kulla, I moved my code there and it worked.

  • Verified answer
    Suresh Kulla Profile Picture
    Suresh Kulla 44,614 on at
    RE: custom code in 'No. - OnValidate()' method of the No. field of 'Job Ledger Entry' table (169) not executing

    The Job Ledger Entry is created during job journal posting and which calls 1012 Codeunit, it has a function called CreateJobLedgEntry, you can add the code in that function to assign the value.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,492 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,305 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans