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)

XRM tooling: Update pick list value to NULL

(0) ShareShare
ReportReport
Posted on by 655

Folks, i'm stuck trying to set a picklist value to NULL using CRMServiceClient on a WPF form. Updating a picklist to another value works great, i'm just having trouble setting it to null or empty.

If i set it to something other than NULL, meaning a value that's not one in a picklist, then it displays empty null string correctly on the CRM form. But in the DB it's populated with that 'dummy' value which would sort of cause some confusion.

Here is what i have so far but it's throwing an error when i pass null in the wrapper. It works if i put "-1".  Is this the value to use to reset the pick list to an unassigned value?

CrmServiceClient svcClient = ctrl.CrmConnectionMgr.CrmSvc;
Dictionary<string, CrmDataTypeWrapper> inData = new Dictionary<string, CrmDataTypeWrapper>();
inData.Add("new_srq",new CrmDataTypeWrapper(null, CrmFieldType.Picklist));

bool success = svcClient.UpdateEntity("account", "accountid", new Guid(guid), inData);

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    You should be able to set a field value to null using business rules if you have CRM 2015.

  • SavvyLuke Profile Picture
    655 on at

    Jonathan, but wouldn't that only apply if the user opens a form?  I need to update this field for about 15K records.  And i can't set them to NULL or UNSELECTED.

  • Community Member Profile Picture
    on at

    I have exactly the same problem as you; did you eventually find a solution?

  • Suggested answer
    Community Member Profile Picture
    on at

    I found the solution!

    use CrmDataTypeWrapper(null, CrmFieldType.Raw)

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