Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6477219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:55:17+00:00 2026-05-25T06:55:17+00:00

I am trying to update a Entity that is an OptionSetValue, the values it

  • 0

I am trying to update a Entity that is an OptionSetValue, the values it will update from are in a radioboxlist and one of the option is blank/null. Is there a way to pass the null value to CRM Entity to update?

This is the radiobox list:

<asp:RadioButtonList RepeatDirection="Vertical" Width="250px" CellPadding="0" CellSpacing="0" ID="rblChangeButtonType" runat="server" AutoPostBack="False" SelectedValue='<%# Bind("EvalVal") %>'>
  <asp:ListItem Value="" Text="No Evaluation Yet" />
  <asp:ListItem Value="100000000" Text="A - Pending order or visit" />
  <asp:ListItem Value="100000001" Text="B - 75% probability of a sale in 6 months" />
  <asp:ListItem Value="100000002" Text="C - 50% probability of a sale in 12 months" />
  <asp:ListItem Value="100000004" Text="F - 0% probability of a sale" />
</asp:RadioButtonList>

And this is the code I am using to update the Entity, it works for all the values but the blank one.

int colderEval = int.Parse(rblChangeButtonType.SelectedValue.ToString());

OptionSetValue selectedEval = new OptionSetValue(colderEval);

Entity opportunity = new Entity("opportunity") { Id = oppGuid };
opportunity["new_colderevaluation"] = selectedEval;

Any idea how to pass the blank one also?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T06:55:18+00:00Added an answer on May 25, 2026 at 6:55 am

    Just check for your special blank value and then set the field to null if necessary:

    Entity opportunity = new Entity("opportunity") { Id = oppGuid };
    
    if (rblChangeButtonType.SelectedValue.ToString() != string.Empty)
    {
      int colderEval = int.Parse(rblChangeButtonType.SelectedValue.ToString());
      OptionSetValue selectedEval = new OptionSetValue(colderEval);
    
      opportunity["new_colderevaluation"] = selectedEval;
    }
    else
    {
      opportunity["new_colderevaluation"] = null;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to update the entity that has some columns with foreign keys.
I am trying to update several products that are fed from an XML file
I'm trying to declare a Primary Key for an Entity Model that will eventually
I'm trying to update an entity and its related entities as well. For instance,
I am trying to update a field in a table with data from another
I'm getting an error when trying to persist a many to one entity: Internal
We're trying to update an entity via WCF, and the entity contains a Timestamp
I am trying to update an entity using Entity Framework 4.1 in my asp.net
I'm having an issue when trying to programmatically update a DateTime field that already
I am troubleshooting code that is attempting to update a disconnected entity that has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.