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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Business Central forum

Saving data in table of business central using card page

(0) ShareShare
ReportReport
Posted on by 305

Hi

I added two fields, Month and Day in my Employee table extension. I want to fill the month and day from the "Birth date" field on the insert of a new record. What trigger do I use for this? Also, do I need some other function? Below is the code lines I used for extracting the Month and day:

Month := Date2DMY("Birth date", 2);

Day := Date2DMY("Birth date", 1);

Please help.

Thanks

Categories:
I have the same question (0)
  • Verified answer
    Avinash B Profile Picture
    1,455 on at

    Hi

    You can make use of OnAfterValidate event of the Birth Date field.

    Here the advantage is when the user enters/change the birth date, the fields Month and Day will be auto-filled. But if you use OnInsert trigger, only during the employee insert this will be triggered. So preferred to use OnAfterValidate event of the field Birth Date.

    Regards

    Avinash B

  • khudeja Profile Picture
    305 on at
    [quote user="Avinash B"]

    Hi

    You can make use of OnAfterValidate event of the Birth Date field.

    Here the advantage is when the user enters/change the birth date, the fields Month and Day will be auto-filled. But if you use OnInsert trigger, only during the employee insert this will be triggered. So preferred to use OnAfterValidate event of the field Birth Date.

    Regards

    Avinash B

    [/quote]

    Hi

    This worked!

    Thanks

  • M Hussnain Javed Profile Picture
    241 on at

    Use 

    Trigger OnValidate()

    var

    begin

    end;

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

News and Announcements

Season of Giving Solutions is Here!

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Business Central

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans