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

Question

Question

Removing pages from paginated form

asked on December 3, 2019

I have a packet of forms for a new hire. I need to break them up into individual documents before saving them to the repository. So I copy the packet and delete all but the desired form. Although it warns me that the rules on a page will be deleted if I delete the page, it doesn't actually remove the rules so I have to go to field rules and remove those too. Is this the expected behavior? I don't think it worked that way in Forms 10.2.

0 0

Replies

replied on December 3, 2019

If you remove page breaks or fields, any reference to those fields/pages in field rules should be removed. If you remove all targets of a field rule, the field rule should be removed entirely. 

If for some reason that doesn't work as intended, field rules targeting fields that don't exist on the form shouldn't affect the user task. 

6.4.1
1 0
replied on December 4, 2019

This doesn't work on our system. If I don't manually delete the field rules when deleting fields from a form in the packet, I get a LFF502-Unexpected Error when I try to display the revised form.

An unexpected error has occurred. [LFF502-UnexpectedError] Details: URL: /Forms/webapi/v1/form/CommitFormLayout?id=872 Error: UnexpectedError Date: 12/4/2019 10:54:05 AM (Central Standard Time) HTTP Status Code: 500 Business Process ID: 0 User: AD\sheryl.berry IP: 169.151.165.91 Browser: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36 Business Process Name: Stack Trace: Caught exception: Laserfiche.Forms.CommonUtils.Exceptions.LFFormsException Message: An unexpected error has occurred. [LFF502-UnexpectedError] Inner exception: System.InvalidOperationException Message: Attaching an entity of type 'Laserfiche.Forms.EntityModels.cf_rules' failed because another entity of the same type already has the same primary key value. This can happen when using the 'Attach' method or setting the state of an entity to 'Unchanged' or 'Modified' if any entities in the graph have conflicting key values. This may be because some entities are new and have not yet received database-generated key values. In this case use the 'Add' method or the 'Added' entity state to track the graph and then set the state of non-new entities to 'Unchanged' or 'Modified' as appropriate. at System.Data.Entity.Core.Objects.ObjectContext.VerifyRootForAdd(Boolean doAttach, String entitySetName, IEntityWrapper wrappedEntity, EntityEntry existingEntry, EntitySet& entitySet, Boolean& isNoOperation) at System.Data.Entity.Core.Objects.ObjectContext.AttachTo(String entitySetName, Object entity) at System.Data.Entity.Internal.Linq.InternalSet`1.ActOnSet(Action action, EntityState newState, Object entity, String methodName) at System.Data.Entity.Internal.Linq.InternalSet`1.Attach(Object entity) at System.Data.Entity.DbSet`1.Attach(TEntity entity) at Laserfiche.Forms.EntityModels.cf_fields.DeleteFieldAndRules(IEntityContext appContext, cf_fields field) at E_Forms.Models.ViewModels.Design.FieldModel.WriteFieldsToDb(cf_forms currentForm, cf_bp_processes topLevelProcess, cf_users currentUser) at E_Forms.WebApi.Version1.Controllers.FormController.CommitFormLayout(Int32 id) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClassc.<GetExecutor>b__6(Object instance, Object[] methodParameters) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()

0 0
replied on December 9, 2019 Show version history

I'm not able to reproduce issue on 10.4.1.172 when delete some fields which are used in field rules in copied form.

From attached log" Inner exception: System.InvalidOperationException Message: Attaching an entity of type 'Laserfiche.Forms.EntityModels.cf_rules' failed because another entity of the same type already has the same primary key value", it seems there is some unexpected data in database.

 

Can you still reproduce such issue with new Form?

If not, it will be great if you can open a support case with your database and we will figure out the root cause and fix it in the product.  

0 0
replied on December 5, 2019

We are using Forms version 10.4.1.172

1 0
replied on December 4, 2019

What version of Forms are you currently using?

0 0
replied on January 19, 2020

We figured out a way to reproduce the same error with following steps:

  1. add 3 fields(A,B,C) to the form
  2. add a field rule to show A,B when C is 1
  3. delete field C, and check from field rules page, the field rule no longer appears
  4. delete field A and B then preview the form

The issue happened at the situation when you delete all the fields used in action(show/hide) then delete multiple fields used in the condition(when) of same field rule. 

Bug 221241 is filed for tracking.

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

Sign in to reply to this post.