Notifications
Announcements
No record found.
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].ClearBut when I try to clear an option set value, I can't see such an option. I can only set 'Assign':And in 'Assign' I see only 'Active', 'Inactive'. Can't see 'null' or something like that.Thank you in advance.
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?
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?
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
But if you want to do it in code then (I think) the bottom code should be fine
entityForm.entity.properties["fieldname"] = null;
Setting default value to 'Unassigned Value' made it possible. Didn't check your code tho, didn't need to do so.Thank you!
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Tom_Gioielli 55 Super User 2025 Season 2
Daniyal Khaleel 25 Most Valuable Professional
Soundari 15