K2 Five Upgrade Breaks Popular SmartForm Control and How To Fix It

By: Roman Duban

After upgrading from K2 5.3 to K2 5.4, some customers found that K2 Designer had stopped working. Although no upgrade errors were reported and K2 Configuration Analyzer did not show any critical errors, K2 Designer was unusable, showing only a red icon. An error message is presented but can only be read after selecting the page with a mouse. The same result happens when browsing the SmartForms runtime site.

The error, Method not found:
‘System.String SourceCode.Forms.Client.Styling.Style.get_BackgroundImage()’ is thrown by a custom control in the K2 environment, which tries to use a method from SourceCode Forms SDK, which is not available in K2 version 5.4.

To resolve the error and get K2 Designer working correctly, you need to have the source code for the custom control, fix the code, rebuild the DLL and copy it to:

K2 Program Folder\K2 Smartforms Designer\bin
and to
K2 Program Folder\K2 smartforms Runtime\bin folders

Also, you may need to register the custom control again. More details about how to deploy and register a custom control can be found in the documentation created for the ctrlutil.exe tool.

https://help.nintex.com/en-US/k2five/devref/5.5/default.htm#Controls/Use-ctrlutil.exe.html

The tool described in the documentation also can be used to get a list of all installed controls in a K2 environment using the command: controlutil list

If the custom control source code is not available or the custom control is no longer in use, it makes sense to deregister the control. You also can replace the failing control with a different one. As further described in the above-referenced link, the tool also provides these commands:

  • controlutil deregister -control:{controltypename}
  • controlutil deregister -assembly:{assemblyfilepath}
  • controlutil deregister -control:{controltypename} [-replaceWith:{controlName}]
  • controlutil deregister -assembly:{assemblyname} [-replaceWith:{controlName}]

If you are not sure where the custom control is used in views and forms, use the K2 package and deployment tool to create a new package and, in the package, check the control dependencies. To see more detail about how the control is used in the form or view before replacing it with another control, you can use Bytezoom SmartForm Inspector. SmartForm Inspector allows you to see control property values and help search rules where the control is involved even when the Designer site is not available.

If you encounter issues with a custom SmartForm control after upgrading K2 or any other problems related to a K2 upgrade, the Bytezoom team will be happy to share our experiences and help you.

Update your K2 Five platform with caution!

Taking precautions can avoid unpleasant surprises like the one just described. Related to the product support lifecycle policy of the K2 platform, you need to have a plan to upgrade K2 to a new version. The planned timeline should recognize the Support Lifecycle end date given on the Nintex/K2 Help portal. Following upgrade recommendations will avoid critical system errors. The Nintex/K2 team provides detailed information about K2 Product Support and Release Strategy on their help portal at:

https://help.nintex.com/en-US/platform/K2Support/K2ReleaseStrategy.htm

Different versions of K2 may have other requirements; therefore, the upgrade process may not only consist of downloading and running the new installer but may require additional steps.

Before updating the production environment, it is essential to update the development environment, which should be as similar as possible to the production environment. For example, it should have the same operating system, database, and other related components. A crucial part of upgrading the development environment is testing K2 applications for breakage. Therefore, the same version of K2 applications running in the production environment should be deployed to the Development Environment. Those applications should be used for testing the development environment upgrade.

Particular attention should be paid to those applications that use custom extensions such as custom service brokers, SmartForm controls, themes, and scripts. The proper functioning of these elements is critical for the reliable operation of business applications. Therefore, custom components warrant careful examination before they are approved for production applications. Using system components where the vendor is unknown or does not provide technical support carries a risk of failure at some point in the application lifecycle, especially considering the long life of most K2 applications. Many K2 custom extensions are distributed on an AS-IS basis by the K2 community or have been developed within the organization or by outsourced experts who are here today and gone tomorrow. K2 extension products designed for older versions of K2 and SmartForms may rely on now deprecated application interfaces that sometimes get retired, leaving unmet dependencies when upgrading to a new version of K2. In fact, K2 version 5.4 no longer provides some of the extension points available in previous versions.

The image above, taken from the Nintex K2 Process Platform Documentation site, compares application extension points provided in K2 version 5.3 with extension points provided in K2 version 5.4. As you can see, a significant number of points are no longer listed. If the application you are upgrading uses integration points that are not available in the new version, you will need to work around the change in various ways depending on your application. It may be as simple as removing components that are not in use or replacing one SmartForm control with another. In some cases, you may need to modify the source code in a custom service broker.

A Bytezoom Expert can help with upgrade planning. To get things started, schedule a short no-cost call with a Bytezoom K2 expert. Just use this link to our Calendar and schedule a 30-minute meeting at a time of your choosing.

 

Be the first to comment

Leave a Reply

Your email address will not be published.


*