Introduction

When a SQL Service Instance is created in K2 Workspace and the native execution is set to false, and a SmartObject is created and executed, a “Specified cast is not valid” error occurs on the GetList method as a result of the Date/Time datatype set in the database.

Error Scenario

Note: The circumstances described in this article are one scenario under which this issue may, or is known to occur. The description is intended to be specific to the scenario described and does not take into account all possible scenarios or circumstances.

To reproduce this error:

  1. Create a SQL Database, and create a table in the new database. (One of the columns needs to be of datatype DateTime).
  2. In K2 Workspace create a SQL Service Instance.
  3. Change the native execution to false.
  4. Using the K2 SmartObject Tester, register a Service Instance.
  5. Create a SmartObject from that Service Instance.
  6. Execute the SmartObject and run a List Method.
  7. The error will occur.

Error Message

Specified cast is not valid

Error Resolution

This Hotfix is contained within the latest K2 Update. Install the update package to resolve the error.