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

How do you test a date field for null value in a plug-in using c#

$
0
0

I am trying to test a date field to see if its null or has no value but no luck.

The field is blank on the form.

If I use  == null  it fails.

When I get the value of the blank date field it returns 1/1/0001 12:00a etc.

I test against the return value as follows:

datefield.ToShortDateString() == "1/1/0001";

it always returns true regardless of the value of the datefield.

I am trying to use the QueryByAttribute method but can't figure out the syntax, I haven't seen any date related examples.

Any help or suggestions would be greatly appreciated.

Thanks


Viewing all articles
Browse latest Browse all 46379

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>