Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 82002

Plugin Triggered by lookup field

$
0
0

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
  } 

}



Viewing all articles
Browse latest Browse all 82002

Latest Images

Trending Articles



Latest Images