Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

249
Views
Dynamics 365 CRM Getting a two optionset value (yes or no) and using it to disable all form fields in Javascript

in Dynamics 365 CRM form there's a checkbox field named opu_paid, if its unchecked, im supposed to disable all fields in the form in javascript. so far im stuck in my code on how to get the value from this checkbox field (wether its true or false) so i can use "setDisabled" method

How do i get the the checkbox field value ?

var formContext = Context.getFormContext();
var paidCheckbox = formContext.getAttribute("opu_paid").getValue() // this is not working 

if(!paidCheckbox)
{
    formContext.getControl("firstname").setDisabled(true);
    formContext.getControl("lastname").setDisabled(true);
}
else
{
    formContext.getControl("firstname").setDisabled(false);
    formContext.getControl("lastname").setDisabled(false);
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Pretty sure your attribute name is wrong. Attributes will either be OOB attributes or are required to have a prefix of "something_" to it.

What you have is correct otherwise. If you need more help, you'll need to provide better details like what is getValue() returning? How is it not working?

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!