When the customer implements a custom KPI code for the A/B test with our document: key-performance-indicators, it throws a database error when trying to start an A/B test with the customer KPI.
The error message is:
The conversion of a datetime2 data type to a DateTime data type resulted in an out-of-range value.\r\n. The statement has been terminated.
The explanation and solution are stated here: the-conversion-of-a-datetime2-data-type-to-a-DateTime-data-type
One simple solution is to modify the constructor DemoKPI in the example KPI code as follows:
this.CreatedDate = DateTime.UtcNow;
this.ModifiedDate = DateTime.UtcNow;
this._servicelocator = ServiceLocator.Current;