Check CRM form field value Empty or Not
<p>I want to check CRM form fields value empty or not at C# plugin code.</p>

<pre><code>Entity ent; 

if(ent.Attributes["telephone2"].ToString()==string.Empty)
{
   Console.WriteLine("");
}
</code></pre>

<p><strong>ent.Attributes["telephone2"].ToString()</strong> this is throwing KeyNotFoundException when <strong>telephone2</strong> field's value is empty. Now I need to check the value of <strong>telephone2</strong> before it throws exception </p>