Hi Creatio Community,
I'm working on a customized Freedom UI form page and need guidance on implementing dynamic filtering for a List component.
Scenario
I have a grid with a native Quick Filter on a lookup field. There is another lookup field in the same object, referencing a different lookup object.
Both lookup objects contain records with matching names, but their record IDs (GUIDs) are different.
Requirement
When a user selects one or more values in the Quick Filter, I want the grid to display records matching either of the following conditions:
Selected Lookup Field IN (Selected Values)
OR
Second Lookup Field IN (Matching Lookup Values)
The matching lookup records should be identified by comparing their Name fields rather than their GUIDs.
All existing predefined filter conditions on the grid must also be preserved.
What I have tried
- Capturing Quick Filter selection using
crt.HandleViewModelAttributeChangeRequest.
- Reading the selected lookup record IDs from the Quick Filter structure.
- Loading the corresponding records from both lookup objects using
sdk.Model.
- Matching the records by Name.
- Dynamically creating lookup filter conditions and adding them to the grid's predefined filter using a nested filter group with OR logic.
- Keeping the root predefined filter's logical operation as AND to preserve existing criteria.
However, the native Quick Filter continues to apply its own condition independently. Consequently, the grid displays only records matching the selected lookup value, while records matching only the second lookup field are excluded.
I also tried modifying the Quick Filter's internal filter collection, but this resulted in a query execution error.
const dynamicItems = {};
dynamicItems["FirstLookupCondition"] = {
filterType: 4,
comparisonType: 3,
isEnabled: true,
leftExpression: {
expressionType: 0,
columnPath: ""
},
isAggregative: false,
dataValueType: 10,
referenceSchemaName: "",
rightExpressions: [{
expressionType: 2,
parameter: {
dataValueType: 10,
value: {
Name: "",
Id: "",
value: "",
displayValue: ""
}
}
}]
};
dynamicItems["SecondLookupCondition"] = {
filterType: 4,
comparisonType: 3,
isEnabled: true,
leftExpression: {
expressionType: 0,
columnPath: ""
},
isAggregative: false,
dataValueType: 10,
referenceSchemaName: "",
rightExpressions: [{
expressionType: 2,
parameter: {
dataValueType: 10,
value: {
Name: "",
Id: "",
value: "",
displayValue: ""
}
}
}]
};
updatedFilter.items["DynamicLookupGroup"] = {
filterType: 6,
isEnabled: true,
logicalOperation: 1,
trimDateTimeParameterToDate: false,
items: dynamicItems
};
updatedFilter.logicalOperation = 0;
request.$context. = updatedFilter;
I also tried modifying the native Quick Filter's internal filter collection to prevent its original condition from being applied. This resulted in a query execution error.
My questions
- Is there a supported way in Freedom UI to intercept or override a native Quick Filter condition while retaining the user's selection in the Quick Filter control?
- Can the native Quick Filter condition be replaced with a custom OR filter involving two different lookup fields?
- Is there a recommended approach using
crt.HandleViewModelAttributeChangeRequest, the grid's predefined filter, or another supported Freedom UI API?
- How can this be implemented while preserving the grid's existing predefined filter conditions?
I would appreciate a working example or guidance on the recommended implementation approach.
Thank you!