I am trying to change value of optionset field using plugin.
if (Membership.LogicalName == "cr456_memebrship")
{
Membership.Id = ((EntityReference)transection["cr456_membership"]).Id;
var MembershipCol = service.Retrieve(Membership.LogicalName, Membership.Id, new ColumnSet("cr456_memebrshipstatus"));
if (MembershipCol.Contains("cr456_memebrshipstatus"))
{
MembershipCol["cr456_memebrshipstatus"] = new OptionSetValue(1);
}
But this code is not working.