Remember Y2K? Well this isn’t nearly as bad, but a new Microsoft Dynamics SL bug surfaced recently (on June 6th, 2019) for many users. You could be receiving a “SQL Server Message 517” when running the Credit Manager’s Assistant screen without specifying a date range.
The reason for this has to do with the limitations of the SMALLDATETIME SQL type, which only allows dates from 1/1/1900 to 6/6/2079. I know we aren’t even close to the year 2079 but there is a bit of code in that screen that suggests a date range of today’s date minus 60 years and plus 60 years. As you may have noticed, we are exactly 60 years from 6/6/2079, so an overflow condition will be thrown unless we force some dates in there.
How to Fix SQL Server Message 517
Fortunately, we can add some VBA code that will force a date range (if none is specified) when the Refresh button is pressed. There are other ways to manage this issue but this should do the trick for most situations. We’ve seen this to be an issue with SL 7, 2011, and 2015.
Listed below is the suggested VBA fix.
Private Sub cmdRefresh_Click() Dim dateFromValue As String dateFromValue = GetObjectValue("cDateRangeFrom") Dim usedateRange As String usedateRange = GetObjectValue("chkUseDateRange") If usedateRange <> "1" Then If dateFromValue = "0" Or dateFromValue = "" Then sivMyApp.Controls("chkUseDateRange").Properties("Enabled") = True sivMyApp.Controls("chkUseDateRange").value = "1" sivMyApp.Controls("cDateRangeFrom").Properties("Enabled") = True sivMyApp.Controls("cDateRangeTo").Properties("Enabled") = True sivMyApp.Controls("cDateRangeFrom").value = "01/01/2010" sivMyApp.Controls("cDateRangeTo").value = "12/31/2025" End If End If End Sub
If you aren’t comfortable doing this yourself, please contact us at firstname.lastname@example.org, and we’ll be glad to help. And be sure to visit and subscribe to our Dynamics SL blog for more tips, current events, and other useful information!