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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

get the optionset value, based on this another field should be read only

(0) ShareShare
ReportReport
Posted on by 1,331

Hi, I am using the following code where "If we select any value from the optionset,firstname should be read only",but i am getting an error--unable to get the property set disabled,if i chose some other field in place of first name,with any selection in the optionset that field is made readonly

code:

function firstnamereadonly()
{
  var option = Xrm.Page.getAttribute("new_contactrole").getOptions();
for(var i in option)
  {
   if(option[i].value == 4)
     Xrm.Page.getControl("firstname").setDisabled("true");
     else
     Xrm.Page.getControl("firstname").setDisabled("false");
   }
}

Thanks in Advance

*This post is locked for comments

I have the same question (0)
  • pavanmanideep Profile Picture
    1,331 on at

    Used ur code,

    unable to get "propery set disabled", was the error message

    can you please check on this

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Varsha deshpande Profile Picture

Varsha deshpande 5

#2
JS-09031509-0 Profile Picture

JS-09031509-0 3

#3
Ciprian  P Profile Picture

Ciprian P 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans