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 :
Finance | Project Operations, Human Resources, ...
Unanswered

Setting default(constant) time in date time control

(0) ShareShare
ReportReport
Posted on by 97

Hi All,

I need to set default time 4 AM  in employee state date field in new employee form (HcmWorkerNewWorker - Form)

I have writtten code like this,but its not working,

How to set default time at 4:00:00 AM in employee state date field.

pastedimage1684137810367v1.png

Thanks in advance.

I have the same question (0)
  • Martin Dráb Profile Picture
    238,769 Most Valuable Professional on at

    Please tell us more about your problem than mere "its not working".

    Debug your code and tell us whether you get the right datetime value from newDateTime(). That will tell you whether you have a problem with getting the value or with putting the value to the form. Then you'll know which part to debug.

  • GirishS Profile Picture
    27,833 Moderator on at

    Hi PJ John,

    Have you debugged the code. From the code what is the data value is coming in the form?

    Thanks,

    Girish S.

  • PJ JohnPaul Profile Picture
    97 on at

    Hi Martin & Girish , 

    Thanks for your reply, sorry for the delay in response.

    In time1 variable i can get value of 14400 , whatever user selected in front end , i can get that date in date1 buffer, 
    but the issue is value for time is not set in the  employeeStartDate.dateTimeValue().Please guide me what i need to do.


    Image

    Thanks in advance.

  • Martin Dráb Profile Picture
    238,769 Most Valuable Professional on at

    Let me repeat my suggestion:

    Debug your code and tell us whether you get the right datetime value from newDateTime(). That will tell you whether you have a problem with getting the value or with putting the value to the form. Then you'll know which part to debug.

  • PJ JohnPaul Profile Picture
    97 on at

    Hi Martin, 

    I am having issue in getting the value from datetimevalue(), it's having time as 12:00:00 . 

    Thanks

  • Martin Dráb Profile Picture
    238,769 Most Valuable Professional on at

    You're talking about a different thing. Please look at the return value of DateTimeUtil::newDateTime(). Is it correct or not?

    It it is, but you can't assign the value to the control, we'll know that we can ignore all the other code and we need to focus on this piece only. For instance, maybe the control is bound to a data source field and you need to assign the value there. But that a speculation - the first step is to localize the problem.

  • PJ JohnPaul Profile Picture
    97 on at

    Hi Martin,

    Thanks for your reply , as you suggested i assigned value to the datasource field, now its working fine.

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 514 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 390

#3
Adis Profile Picture

Adis 266 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans