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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How can I set value of a two options set field using JavaScript

(0) ShareShare
ReportReport
Posted on by 676

I am using this piece of code to set the field's value. 

Xrm.Page.getAttribute("new_isapproval").setValue(false);

When I try to set alert in the code as the retrieved value, it gives false value but when the form loads the fields value is still Yes(true).

Any suggestions would be highly appreciated.


*This post is locked for comments

I have the same question (0)
  • Jason M. Cosman Profile Picture
    5,234 Moderator on at

    Hello Mohd;

    Can you maybe be a bit more specific; like is it saving after setting the value then retrieving? Or is it like your setting the value to false and then retrieving it before saving.

  • Verified answer
    Kristian Cole Profile Picture
    290 on at

    It should be a case that an option set is dictated by numbers over text.

    Try:

    Xrm.Page.getAttribute("new_isapproval").setValue(0);

    Do you have this attached to an onload event? or onchange?

  • Suggested answer
    Dynamics_Alok Profile Picture
    1,746 on at

    Similar Thread https://community.dynamics.com/crm/f/117/t/134489 

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

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
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans