/// <summary> /// MAYBE TRUE FOR DELETE! FIELD MUST BE IN PREIMAGE FOR UPDATE STEP! Returns if the fields value is logically changing /// by inspecting the Target and Preimage /// </summary> public bool FieldChanging(string fieldName) { if (MessageName == PluginMessage.Create || MessageName == PluginMessage.Update) { return(TargetEntity.Contains(fieldName) && !XrmEntity.FieldsEqual(PreImageEntity.GetField(fieldName), TargetEntity.GetField(fieldName))); } else if (MessageName == PluginMessage.Delete) { return(GetFieldFromPreImage(fieldName) != null); } else { //not sure how to get status if a setstate message throw new InvalidPluginExecutionException("FieldChanging Not Implemented for plugin message " + MessageName); } }