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

Notifications

Announcements

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

News and Announcements

Season of Giving Solutions is Here!

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 CRM (Archived)

#1
Shidin Haridas Profile Picture

Shidin Haridas 2

#2
Abdullah13 Profile Picture

Abdullah13 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans