Fixing : Expected non-empty string regarding OptionSet

Introduction
This is quick post about fixing “Expected non-empty string” error. If you are facing same issue this post going to help you!.

Solution
Recently while removing option from option set which seems to be added during data import, we got this “Expected non-empty string“. First we tried to search regarding this error if someone got it already, we found this error is kind of generic error which we can get for multiple reasons but we did not find any solution which was matching our issue.

When we downloaded error log, we saw following details:
Expected non-empty string.
2019-11-25T06:47:17.4217082Z
false


d8ab7ce4-5ded-49f8-bd8c-d594c1a36cba
-2147220970


System.ArgumentException: Expected non-empty string.
Parameter name: label

Based on the error message, we thought of checking option set metadata by exporting entity, so we created a custom solution and added this single entity and single option set field. After extracting zip file when we checked this option set metadata under customization.xml, we found some options are available under this field which don’t have any label like following

optionseterror

To fix this issue we added a dummy label to these options and imported solution back to Dynamics 365 CE organization. After that we were able to delete unwanted options without any issue.

Hope it will help someone!!

Leave a Reply

Your email address will not be published. Required fields are marked *