I have a plugin which should set the web_expireson(datetime field) to nothing when the web_neverexpires(boolean field) is selected. The below code is giving a "Attribute 'web_expireson' should of type DateTime.' error. We are running on-premise crm2011 with UR6.
If en.Attributes.Contains("web_neverexpires") AndAlso en.Attributes("web_neverexpires") = True Then
Ifen.Attributes.Contains("web_expireson")Then
en.Attributes("web_expireson") = Nothing
Else
en.Attributes.Add("web_expireson", Nothing)
End If
End If