Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Unanswered

How to enable and disable Date field in CRM form using JS?

(0) ShareShare
ReportReport
Posted on by

I disabled date field using .setDisabled() as true. But when i disable it using .setDisabled(false), the date picker and input field is greyed out. I tried business rule also. Getting same behaviour. 

Is this a bug? Any alternative solution available?

  • Community Member Profile Picture
    on at
    RE: How to enable and disable Date field in CRM form using JS?

    I'm working in UCI CRM on premise.

    Business Rule:

    pastedimage1633519189428v1.png

    Form behavior: Disable 'Rent Escalation end Date' if 'Does Escalation Rate Vary?' = No. Working fine

    pastedimage1633519309177v2.png

    Form behavior: Enable 'Rent Escalation end Date' if 'Does Escalation Rate Vary?' = Yes. Rent Escalation End date is unlocked/enabled, but date picker not working.

    pastedimage1633519479883v3.png

    Thanks in advance,

    Harisa

  • Pradeep Rai Profile Picture
    5,487 Super User 2025 Season 1 on at
    RE: How to enable and disable Date field in CRM form using JS?

    Hi,

    Can you please share the screenshot of business rule/script. because I tried the same with business rule and it working fine:

    pastedimage1633516179037v1.png

    and with script as well:

    inside script used below code to enable and disabled the datetime field:

    formContext.getControl("fieldlogicalname").setDisabled(true);//disabled

    formContext.getControl("fieldlogicalname").setDisabled(false);//enable

    Thanks,
    Pradeep.

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 the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 225 Super User 2025 Season 1

#2
Eugen Podkorytov Profile Picture

Eugen Podkorytov 106

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 106 Most Valuable Professional

Overall leaderboard

Product updates

Dynamics 365 release plans