Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

ItemUpdating event - Properties.AfterProperties["MyDate"] vs Properties.ListItem["MyDate"]

$
0
0

Hi there,

In my ItemUpdating event I need to check if the MyDate column has changed.

if (p.AfterProperties["MyDate"].Equals(p.ListItem["MyDate"]) == false)
{
 //Date has changed 
}

But this comparison is always false even if the date is not changed. The reason is - AfterProperties["MyDate"] outputs a simple date format - while - ListItem["MyDate"] outputs many lines of data for exactly same date.

How to get these two to output date in same format so comparison can be made?

Thanks so much.


Viewing all articles
Browse latest Browse all 11571

Trending Articles



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