Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Cannot insert the value NULL into column 'SelectedOptionValues',

Posted on by 30

For update operation I can set OptionSetValueCollection field to null; for example:
kc_accountcontact.kc_directions = null

But for create operation I can't set directly OptionSetValueCollection field to null; I get error:
Sql error: 'Cannot insert the value NULL into column 'SelectedOptionValues', table '***.dbo.MultiSelectAttributeOptionValuesBase'; column does not allow nulls. INSERT fails. The statement has been terminated.'

How can I set OptionSetValueCollection field to null for create operation?
I use XrmToolBox / Early Bound Generator; since today this plugin has gotten opportunity to work with  Multi-Select OptionSets, but this doesn't resolve my issue

*This post is locked for comments

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: Cannot insert the value NULL into column 'SelectedOptionValues',

    Hello,

    You can open a ticket with Microsoft and ask for a fix in their core. I'm afraid there is no other way of doing it. Anyway - good luck.

  • nozd Profile Picture
    nozd 30 on at
    RE: Cannot insert the value NULL into column 'SelectedOptionValues',

    Thank's, I know it; now I use this workaround. But I use Upsert operation and I'd like to set null directly as well as other type fields

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: Cannot insert the value NULL into column 'SelectedOptionValues',

    Hello,

    Just don't populate field and it'll be created as null. Experienced this issue as well.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans