Hi guys, i have plugin that triggered by lookup, when lookup value is change, the plugin will execute some logic. But this also cause problem when i clear/set to empty the lookup value, its returning object reference not set to an object. How to avoid this, i mean when the lookup value is set to empty. Just avoid the logic. The plugin registered on Update Message
Entity e = (entity)context.InputParameters["target"]; if(e.Attributes.Contains("new_lookup"){ Guid lookup_value = (e.GetAttributeValue<EntityReference>("new_lookup)).Id; if(lookup_value != Guid.empty){ //Do Logic } }
*This post is locked for comments