A filter should turn off after duplicating a record

Steps to reproduce

  • Define an entity which has a field that resets to empty on duplication and enter some records
  • Open a screen
  • Filter the records by the column that resets on duplication
  • Press Duplicate button

The record disappears because as filter is set to some value and the value was reset, the newly created record no longer conforms to the filter.

Desired behaviour

Filter should turn off when entering a new or duplicating an existing record in order to avoid these situations.

@tvavrda Does “turn off” mean hide the filters or clear all filter values and keep the filters open?

The problem is that the grid tries to re-apply the filter and so the record disappears. But in order to make it obvious to the user, I would do both – hide the filter fields AND reset the filter.

Filtered records by lookup field. Pressed Duplicate button. Got this:

{
    "ClassName": "System.Data.DataException",
    "Data": {
        "logged": true
    },
    "ExceptionMethod": null,
    "HResult": -2146232032,
    "HelpURL": null,
    "InnerException": null,
    "Message": "A child row has multiple parents.",
    "RemoteStackIndex": 0,
    "RemoteStackTraceString": null,
    "Source": "System.Data.Common",
    "StackTraceString": "   at System.Data.DataRelation.GetParentRow(DataKey parentKey, DataKey childKey, DataRow childRow, DataRowVersion version)\n   
	at System.Data.DataRow.GetParentRow(DataRelation relation, DataRowVersion version)\n   
	at System.Data.DataRow.SetNestedParentRow(DataRow parentRow, Boolean setNonNested)\n   
	at Origam.Rule.RuleEngine.RowLevelSecurityState(DataRow row, Object profileId, Guid formId) in D:\\a\\1\\s\\backend\\Origam.Rule\\RuleEngine.cs:line 1743\n   
	at Origam.Server.SessionStore.RowStates(String entity, Object[] ids) in D:\\a\\1\\s\\backend\\Origam.Server\\Session Stores\\SessionStore.cs:line 1318\n   
	at Origam.Server.SessionStore.GetChangeInfo(String requestingGrid, DataRow row, Operation operation, Func`3 RowStateProcessor) 
	in D:\\a\\1\\s\\backend\\Origam.Server\\Session Stores\\SessionStore.cs:line 1083\n   
	at Origam.Server.SessionStore.GetChangesRecursive(ArrayList changes, String requestingGrid, DataRow row, Operation operation, DataRow changedRow, 
	Boolean allDetails, Hashtable ignoreKeys, Boolean includeRowStates) in D:\\a\\1\\s\\backend\\Origam.Server\\Session Stores\\SessionStore.cs:line 943\n   
	at Origam.Server.SessionStore.GetChangesByRow(String requestingGrid, DataRow row, Operation operation, Hashtable ignoreKeys, Boolean includeRowStates, 
	Boolean hasErrors, Boolean hasChanges, Boolean fromTemplate) in D:\\a\\1\\s\\backend\\Origam.Server\\Session Stores\\SessionStore.cs:line 861\n   
	at Origam.Server.SessionStore.CopyObject(String entity, Object originalId, String requestingGrid, ArrayList entities, IDictionary`2 forcedValues) 
	in D:\\a\\1\\s\\backend\\Origam.Server\\Session Stores\\SessionStore.cs:line 2015\n   
	at Origam.Server.ServerCoreUIService.CopyObject(CopyObjectInput input) 	in D:\\a\\1\\s\\backend\\Origam.Server\\ServerCoreUIService.cs:line 357\n   
	at Origam.Server.Controller.UIServiceController.<>c__DisplayClass21_0.<CopyObject>b__0() in D:\\a\\1\\s\\backend\\Origam.Server\\Controller\\UIServiceController.cs:line 214\n   
	at Origam.Server.Controller.AbstractController.RunWithErrorHandler(Func`1 func) in D:\\a\\1\\s\\backend\\Origam.Server\\Controller\\AbstractController.cs:line 116",
    "WatsonBuckets": null
}

I could not reproduce the issues. @JiriPrajz could not reproduce it either.

Hiding the filter creates a problem in lazy loaded screens. The screen is reloaded because the filters were closed. The new row is not in the data leading to the first row to be selected. This causes an error because the edited row is deselected.

Possible solutions:

  • keep the filter open and always show the edited (dirty) row
  • somehow insert the new row after the data is refreshed

I tested on no lazy screen. Rows are showed by filter. i added new one and the row was not showed .