How to Set a Option Set value in post create plugin CRM 2011

Question Status

Abhi asked a question on 9 Feb 2011 10:09 PM

I am  trying  to update option set value using post create plugin. 

Below is the code.


 "shippingmethodcode", new OptionSetValue(shippingMethodValue));


//  where shippingmethodvalue is int

When  i try to save this value, i get the following error :  Specified case is not valid.

Can you plz  let me know  , how to update option set value using plugin.

Thanks in Advance !!!

RV responded on 14 Apr 2011 12:54 AM

Hello ,

try this: entity["shippingmethodcode"] = new OptionSetValue(shippingMethodValue); Are you sure that the value in shippingMethodValue is proper value defined for shippingmethodcode pick list?

Best regards RV