I have a few plugins that is run whenever a field is updated, but sometimes the field is updated to a value the plugin doesn't need to handle, and an if-statement prevents the rest of the plugin code from being run. But in the system job log, one can't see if the plugin execution was preventet - it just says successful. I'd like to be able to see in the log when the plugin was actually run, so I can't check Delete AsyncOperation when successful.
I could throw an InvalidPluginExecutionException with OperationStatus.Cancelled, but I feel like this just clutters the system job log.
Is there a way for the plugin to delete its own system log entry, and would it be safe to do so? Does CRM expect the system log to be there after it is run?
Does checking Delete AsyncOperation also delete thrown InvalidPluginExcecutionException's with OperationStatus.Successful? If not, I could just throw that whenever the plugin successfully ran all its code, and 'return' whenever the code didn't need to run.
Don't know if this can be solved with workflows, but I'd rather not use them.
*This post is locked for comments