Most dates in the SalesLgix web client are nullable DateTimes meaning that they do not need to contain a value. However if you try code like this:
lead.LastCallDate = lastHistory.HasValue ? lastHistory.Value: null;
You will receive an error about how you can not implicitly convert a DateTime to null. The reason for this is more in the syntax of the line of code that the ability to set a date to null. When C# tries to evaluate the if else clause it is detecting that in one case it is using a DateTime but in another it is using just null. These to data types do not compute (ha). Instead what you need to do is just explicitly convert your null to a DateTime? null value like this:
lead.LastCallDate = lastHistory.HasValue?lastHistory.Value: (DateTime?)null;
Simple.



