Unable to cast object of type ‘Microsoft.Xrm.Sdk.OptionSetValue’ to type ‘System.String’

Unable to cast object of type ‘Microsoft.Xrm.Sdk.OptionSetValue’ to type ‘System.String’

if you facing OptionSetValue Cast error in your Plugin use this code to resolve the problem

 OptionSetValue learnerAggrementoptionSetValue = guids.GetAttributeValue<OptionSetValue>(“vwi_learneragreementtype”);

 

if (learnerAggrementoptionSetValue != null)

{

int selectedOptionValue = learnerAggrementoptionSetValue.Value;

}

 

                   

Unable to cast object of type ‘Microsoft.Xrm.Sdk.OptionSetValue’ to type ‘System.String’

https://www.youtube.com/@powerappsninja

Leave a Comment

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