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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
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 

I have the same question (0)
  • Verified answer
    rthompson Profile Picture
    1,532 on at

    Try this

    //Add today's date

    var today = new Date();

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

  • Suggested answer
    Xmejni Profile Picture
    15 on at

    OMG i cant believe its that simple haha, thanks!

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Martin Dráb Profile Picture

Martin Dráb 41 Most Valuable Professional

#2
iampranjal Profile Picture

iampranjal 39

#3
Satyam Prakash Profile Picture

Satyam Prakash 35

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans