I am trying to do the code below but it is not working - anyone know why?
EntityReference cdd = (EntityReference)entity.Attributes["new_case"];
if (cdd != null) { //Do code }
You need to check the null condition before: try with
if (entity.Contains("new_case") && entity["new_case"] != null) { EntityReference cdd = (EntityReference)entity["new_case"]; // do code }
My blog: www.crmanswers.net - Rockstar 365 Profile