Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

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

(0) ShareShare
ReportReport
Posted on by 1,329

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

  • pavanmanideep Profile Picture
    pavanmanideep 1,329 on at
    RE: get the optionset value, based on this another field should be read only

    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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,031 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,868 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans