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

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Answered

Resco (woodford) - Clear OptionSet field's value

(0) ShareShare
ReportReport
Posted on by 5

Hello,

How can I clear the value of option set field in woodford (resco) in script? (onLoad, onChange, onSave)

I know how to clear non option-set values (for example string, int etc...) 

Step -> Entity.[some_field].Clear

pastedimage1601550457752v1.png

But when I try to clear an option set value, I can't see such an option. I can only set 'Assign':

pastedimage1601550492684v2.png

And in 'Assign' I see only 'Active', 'Inactive'. Can't see 'null' or something like that.

Thank you in advance.

I have the same question (0)
  • DynDev1855 Profile Picture
    5 on at
    RE: Resco (woodford) - Clear OptionSet field's value

    Setting default value to 'Unassigned Value' made it possible. 

    Didn't check your code tho, didn't need to do so.

    Thank you!

  • Verified answer
    Thomas David Dayman Profile Picture
    11,323 on at
    RE: Resco (woodford) - Clear OptionSet field's value

    So what I noticed is that if you have Default value as 'Unassigned Value' then you will get the option to assign as (Empty) in Woodford

    2783.Screenshot_5F00_1.png

    4863.Screenshot_5F00_2.png

    But if you want to do it in code then (I think) the bottom code should be fine

    entityForm.entity.properties["fieldname"] = null;

  • DynDev1855 Profile Picture
    5 on at
    RE: Resco (woodford) - Clear OptionSet field's value

    The statecode field was only an example. It can be whatever custom field, but it needs to be option set.

    So for example let's say I have a field:

    new_testOptionSetField

    Type: OptionSet

    Values: Test1, Test2, Test3

    What I want to achieve - I want to clear this value onSave (so when I save the form, I want to have value of this field cleared (set to null))

    I can do this by javascript doing this:
    Xrm.Page.getAttribute("new_testOptionSetField).setValue(null)

    How to do this in woodford?

  • Thomas David Dayman Profile Picture
    11,323 on at
    RE: Resco (woodford) - Clear OptionSet field's value

    I dont think you can clear a statecode field? Either the record is active or inactive.

    But you clear a custom optionset field and assign it as (Empty)

    What are you trying to achieve exactly?

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…

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 100 Super User 2025 Season 2

#2
Suresh Kulla Profile Picture

Suresh Kulla 72 Super User 2025 Season 2

#3
DAnny3211 Profile Picture

DAnny3211 54

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans