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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Change date time value on control in form

(0) ShareShare
ReportReport
Posted on by

I have a couple of controls in a form with DateTime type. On the init of the form, I am trying to change one of the values to a specific value,  however, it is not updating. String controls work fine.

datetime = datetime2str(element.formatDateTimeToday());
Registration_StartRegistrationDateTime.setUTCString(datetime);


I have also tried using this, but it did not work either,

Registration_StartRegistrationDateTime.dateTimeValue(*UTCDATETIME*);


Any ideas what I am doing wrong?

Additionally, I have another issue, when i select a control to edit (upon click), all the other controls are also updated with the same value.

Thanks,

Matthew

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Mea_ Profile Picture
    60,286 on at

    Hi Matthew Calleja,

    If controls are bound to data source fields you need to change field value instead of control value.

    If controls are not bound code like:

    Registration_StartRegistrationDateTime.dateTimeValue(DateTimeUtil::utcNow());

    should work without any issues.

    Regarding your second question you can have such behaviour if multiple controls are bound to same data source filed, in this case value change in one control will change it in all.

  • Suggested answer
    Community Member Profile Picture
    on at

    Thanks a lot for your answer. Helped a lot!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans