You are viewing limited content. For full access, please sign in.



Error (LFF502-UnexpectedError) After Upgrading Forms to Version 11 Update 3

asked on January 30

I have a particular process (via classic designer) that is failing after upgrading to Forms Version 11 Update 3.  I'm still investigating, but I'm wondering if anyone else has seen this issue and can point me in the correct direction.

This is a process we've had since 10.2 with no major changes, and it worked without issue on Version 11 Update 2, but started this issue with the upgrade to Update 3.

When a user opens a task assigned to them with the form, it just closes automatically and returns to their Inbox.  When I preview the form from the designer, I receive an error stating: LFF502-UnexpectedError.  This happens on loading the preview.  I've already ruled out unassigned variables and my Javascript (I commented it all out), so it's something from the Layout page.

Here's what the event viewer says: 

An unexpected error has occurred. [LFF502-UnexpectedError]

URL: /Forms/form/preview/75/0
Error: UnexpectedError
Date: 1/30/2023 10:26:07 AM (Mountain Standard Time)
HTTP Status Code: 500
Business Process ID: 34
Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ Safari/537.36
Business Process Name: New Member Onboarding

Stack Trace:
Caught exception: Laserfiche.Forms.CommonUtils.Exceptions.LFFormsException
Message: An unexpected error has occurred. [LFF502-UnexpectedError]

Inner exception: System.InvalidCastException
Message: Unable to cast object of type 'System.Data.Entity.DynamicProxies.cf_forms_3C41E27BE29C1414189B8A395E00BA02D82890E1368643617A4AC44EC5ED2348' to type 'Laserfiche.Forms.EntityModels.cf_theme'.
   at Laserfiche.Forms.EntityModels.Services.FunctionCacheService.<>c__DisplayClass4_0`2.<Memoize>b__0(TArg param)
   at E_Forms.Models.ViewModels.Form._BaseFormModel._PopulateFormValues(Int32 formId)
   at E_Forms.Models.ViewModels.Form._BaseFormModel.PopulateFormValues(Int32 formId)
   at E_Forms.Controllers.FormController.NewSubmission(Int32 formId, String mode, Int32 instanceId, Int32 loadDb, Boolean HideHeader)
   at lambda_method(Closure , ControllerBase , Object[] )
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c.<BeginInvokeSynchronousActionMethod>b__9_0(IAsyncResult asyncResult, ActionInvocation innerInvokeState)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass11_0.<InvokeActionMethodFilterAsynchronouslyRecursive>b__0()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass11_2.<InvokeActionMethodFilterAsynchronouslyRecursive>b__2()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass11_2.<InvokeActionMethodFilterAsynchronouslyRecursive>b__2()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass3_6.<BeginInvokeAction>b__4()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass3_1.<BeginInvokeAction>b__1(IAsyncResult asyncResult)


0 0


replied on January 30

So I made a copy of the form within the process, with the intent of making iterative changes (probably deleting a couple fields at a time) to try to narrow down which field(s) were causing the error.

And the copy worked without the error.

Because I like to know "why?" in all things, I carefully compared all fields on the original version of the form (still throwing the error) and the copy of the form (not throwing an error).  Everything looks identical!  There is nothing I can see anywhere in the designer that shows why one version of the form works and one doesn't!  That's so weird to me.

So then I tried to make a tiny change to the original form and save it, and it just kind of got stuck saving indefinately.  So whatever happened with the copy function that resolved the underlying issue, doesn't seem to have with the save function.

Ultimately, to get going again, I reassigned all the tasks that used that form to the new version of the form.  But I'm still rather annoyed that I have no idea what is wrong with the original copy.

2 0


replied on February 1

The issue will only happen when the id of the form is same as the id of the theme, that's why it will not happen with the copied form. It is a regression bug introduced in Forms 11 Update 3.

2 0
replied on February 1

Oh!  Thanks for the explanation!

0 0
replied on February 1

Interesting we've experienced the same issue with one of our forms. I noticed the correlation between the cf_forms.form_id and of the affected form - but couldn't assume causation.


If we have multiple steps in the process tied to the form_id affected by the regression bug; is it possible to duplicate the form and swap the cf_forms.theme_id references in the backend?


(I'm wondering if there is an alternative to manually finding all of the User Tasks in the Process Diagram and selecting the newly duplicated form)

0 0
replied on February 1

Hey @████████ - I don't know if I would dare to try to edit that in the in the datebase.  Too much could go wrong.

But if you have a lot of stuff in the process and just want a leg up on trying to identify which tasks are referring to the broken form, this query will likely help - it finds every task in the process that refers to that form (as long as the names you search for are unique enough not to match other stuff): 

FROM [LFForms].[dbo].[cf_forms] AS f
LEFT JOIN [LFForms].[dbo].[cf_form_process_mapping] AS fm ON fm.form_id = f.form_id
LEFT JOIN [LFForms].[dbo].[cf_bp_step_form_mapping] AS sfm ON sfm.[form_id] = f.[form_id] AND sfm.[process_id] = fm.process_id
LEFT JOIN [LFForms].[dbo].[cf_bp_steps] AS step ON step.process_id = fm.process_id AND step.[step_id] = sfm.[step_id]
LEFT JOIN [LFForms].[dbo].[cf_bp_processes] AS bp ON bp.process_id = fm.process_id
LEFT JOIN [LFForms].[dbo].[cf_business_processes] AS bp2 ON bp2.bp_id = bp.bp_id
  f.[name] LIKE '%BROKEN%'   --Full or partial name of the form - I listed BROKEN, because I put that in the name of the non-working version of the form.
  AND bp2.[name] LIKE '%PROCESS%'   --Full or partial name of the process
  AND step.[definition_json] IS NOT NULL


0 0
replied on February 2 Show version history

Changing the form id in the related configuration can be risky as it is used in many places. You can run following SQL queries to change the theme_id instead after backup your database((replace the {formIdGetfromURLWhenOpenLayout} with the actual form ID)

declare @formid int={formIdGetfromURLWhenOpenLayout}
declare @newThemeId int
insert into [cf_theme] ([type],[name],[json],[css],[show],[logo_id],[theme_sub_type]) select [type],[name],[json],[css],[show],[logo_id],[theme_sub_type] from [cf_theme] where id=@formid
select @newThemeId=SCOPE_IDENTITY()
update [cf_forms] set theme_id=@newThemeId where form_id=@formid
delete from [cf_theme] where id=@formid


2 0
replied on February 8

Thanks for this Xiuhong

I can verify that it worked for our site.

I used the following SQL query to identify which Forms match the themeID. I knew of two forms that were affected. Turns out we had eight.

  FROM [LF-Forms].[dbo].[cf_forms]
  where form_id =  theme_id


0 0
replied on February 8 Show version history

Sorry for the regression bug that cause problems. We are also working on a hotfix that will address this issue so you do not need to change the database to solve it and the hotfix is targeted to be released in next week. 

0 0
replied on February 14

Laserfiche has released the update for Forms 11 Update 3 with this bug fix, see more information from

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.