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

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Lock &Unlock the date and time

(0) ShareShare
ReportReport
Posted on by 10

my question is consider a two fields arrival date and departure date these fields are date and time  data type , by default departure field is lock when insert a date on arrival field then departure field has to unlock.

I have the same question (0)
  • Suggested answer
    ONENEXT Profile Picture
    10 on at
    RE: Lock &Unlock the date and time

    I need a js code .

  • Suggested answer
    Nya Profile Picture
    29,060 on at
    RE: Lock &Unlock the date and time

    Hi,

    The code is something like the following snippet.

     

    function setDeparturedate (executionContext) {
      var formContext = executionContext.getFormContext();
      formContext.getControl("new_departuredate").setDisabled(false);//Use the name of the field
    };

    Please set it on the OnChange event of the "Arrival Date" field.

     pastedimage1624246246801v1.png

    Then the "Departure Date" field can be unlocked when "Arrival Date" field has been changed.

     pastedimage1624246250390v2.png

    pastedimage1624246256599v3.png

    If this helped you, I'd appreciate it if you'd mark this as a Verified Answer, which may in turn help others as well.

    Best Regards,

    Nya

  • meelamri Profile Picture
    13,216 User Group Leader on at
    RE: Lock &Unlock the date and time

    Hello ONENEXT,

    Please share some screenshots and the technical name of your fields...It will help to solve your issue

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
Sahan Hasitha Profile Picture

Sahan Hasitha 169

#2
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 65

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 63 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans