Skip to main content

Notifications

Microsoft Dynamics 365 | Integration, Dataverse...
Answered

setting a date time field in Javascript for Unified Interface

(0) ShareShare
ReportReport
Posted on by 15

Hi 

How does one set a datetime field in JS for UCII?

The standard formContext.getAttribute("xxx").setValue(new Date()); doesn't seem to work anymore throwing a 

Value should be of type: DateTime: Parameter Name: undefined

I have tried setting to UTC but to no avail. Any ideas? 

Thanks

Charmaine 

  • Suggested answer
    Xmejni Profile Picture
    Xmejni 15 on at
    RE: setting a date time field in Javascript for Unified Interface

    OMG i cant believe its that simple haha, thanks!

  • Verified answer
    rthompson Profile Picture
    rthompson 1,530 on at
    RE: setting a date time field in Javascript for Unified Interface

    Try this

    //Add today's date

    var today = new Date();

                           formContext.getAttribute("new_assigntoengineeron").setValue(today);

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…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

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

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,965 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,817 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans