How do I filter records by optionset value? I am trying like this:
"$select=new_id&$filter=new_campaignid/Id eq guid'" + myId+ "' and new_optionsetfield eq '" + optionsetCode + "'"
But this does not work. I keep on getting bad request with error message:
Operator 'eq' incompatible with operand types
'Microsoft.Crm.Metadata.ComplexTypeInstance`1[[Microsoft.Xrm.Sdk.OptionSetValue, Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]'
and 'System.String' at position 96.