Code Fix: An error occurs when you execute the Activity Instance Destination SmartObject
After upgrading to K2 Five (5.3) April 2020 Cumulative Update, an error occurs when you execute the Activity Instance Destination SmartObject.
The following error occurs: “SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM”
The fix is available in the following K2 versions:
|K2 4.7 December 2019 Cumulative Update||K2 Five (5.0) December 2019 Cumulative Update||K2 Five (5.1) November 2018 Cumulative Update||K2 Five (5.2) May 2019 Cumulative Update||K2 Five (5.3) April 2020 Cumulative Update||K2 Platform Classic(5.4)|
|X||X||X||X||Fix Pack 22||Fix Pack 13|
- Ensure you have the correct K2 version and/or Cumulative Update installed. See KB001893 to see what Fix Pack level you have installed.
- Download the latest Fix Pack using the links in the table above for the version you require.
- Install the Fix Pack to apply the fix.
This issue occurred due to changes made previously to improve the accuracy of the Activity Instance Destination SmartObject. After installing the Fix Pack, you now have the option to use the old behavior.
Follow these steps to make use of the old behavior:
- Stop the K2 Host Server.
- Execute the following query on the K2 database:
DECLARE @XML NVARCHAR(MAX)
DECLARE @GUID NVARCHAR(MAX)
SELECT @GUID = [Guid] FROM [K2].[SmartBroker].[ServiceInstance] WHERE [name] = 'WorkflowReportingService'
SET @XML = <service><key name="Behavior">pre-aidid</key> </service>'
UPDATE [K2].[SmartBroker].[ServiceObject] SET [ServiceKeysXML] = @XML WHERE [ServiceInstanceGuid] = @GUID AND [Name] = 'ActivityInstanceDestination'
- Start the K2 Host Server.
- If you used the Activity Instance Destination SmartObject in a workflow, change the filter to use the Activity Display name instead of the Activity name and ensure the activities are executing as the K2 Service account.