Validating missing "Object Not Set to a Reference" on Form Rule Sets in K2 Designer

  • 24 February 2022
  • 0 replies
  • 3 views

Userlevel 5
Badge +20
 

Validating missing "Object Not Set to a Reference" on Form Rule Sets in K2 Designer

kbt145421

PRODUCT
K2 blackpearl 4.6.10 to 4.7
BASED ON
K2 blackpearl 4.6.11
This article was created in response to a support issue logged with K2. The content may include typographical errors and may be revised at any time without notice. This article is not considered official documentation for K2 software and is provided "as is" with no warranties.
LEGACY/ARCHIVED CONTENT
This article has been archived, and/or refers to legacy products, components or features. The content in this article is offered "as is" and will no longer be updated. Archived content is provided for reference purposes only. This content does not infer that the product, component or feature is supported, or that the product, component or feature will continue to function as described herein.

Issue

When editing Form rules the following error appears: "Object Reference not set to an instance of an object"

 

Image

Symptoms

You are unable to edit any form rules on form level due to invalid event definitions.

Error:

"Object Reference not set to an instance of an object"

Troubleshooting Steps

Please note that the following steps are only applicable to K2 4.6.11 and older. The SQL Query is not compatible with K2 Five.

 

To determine if there are missing orphaned references, execute the script below:

 

 

--######################################################################

--### Instructions ###

-- 1. Check out only the forms that have the Object Reference error which you want to fix.

-- 2. Run the SQL script against the K2 database.

--######################################################################

 

 

Use [K2Database]

GO

declare @OrpanedReference int

select @OrpanedReference = count(*) from (

                select ID

               from [Form].[HandlerInstance_Design]

               where

                                 Functions.value('(/Function/@InstanceID)[1]', 'nvarchar(50)') is not null and

                                 Functions.value('(/Function/@InstanceID)[1]', 'nvarchar(50)') not in (SELECT [ID] FROM [Form].[AreaItem_Design])

                                 ) as a

 

if(@OrpanedReference>0)

begin

                     print 'There are ' + cast(@OrpanedReference as nvarchar(10)) + ' orphaned references found.'

end

else

                     print 'There were no orphaned references found.'

 

 

Under normal circumstances, no data should be displayed on any of the results.

 

Should the results display data, it means that orphaned references were found, which is the cause of the error.

 

Image

To resolve this issue, direct database modification will be required. Please log a K2 Support Ticket on the K2 Customer Portal for assistance in resolving the issue.

 

Please Note that direct K2 database modification is not allowed as it might leave the environment in an unsupported state. This must only be done with the assistance of, or when instructed to do so by K2 Support.

0 replies

Be the first to reply!

Reply