Hello creatio community,
I am trying to apply a filter into cases mini page which is developed using freedom ui screens. Code as below:
{
request: "crt.LoadDataRequest",
handler: async (request, next) => {
if(request.dataSourceName == "CaseDS_OPCaseType_4943d10_List_DS") {
const caseType = await request.$context.CaseDS_OPCaseType_4943d10;
var moduleTypesIds = await OPPermissionFunctionsSsp.getModuleTypes();
const filter = new sdk.FilterGroup();
if(moduleTypesIds.length > 0){
filter.logicalOperation = sdk.LogicalOperatorType.Or;
for (let i = 0; i < moduleTypesIds.length; i++) {
await filter.addSchemaColumnFilterWithParameter(sdk.ComparisonType.Equal, "Id", moduleTypesIds[i].value);
}
}
else{
await filter.addSchemaColumnFilterWithParameter(sdk.ComparisonType.Equal, "OPCode", '');
}
const newFilter = Object.assign({}, filter);
newFilter.items = filter.items;
request.parameters.push({
type: "filter",
value: newFilter
});
}
return await next?.handle(request);
}
}
The filter newFilter shows the right filter condition. I also used sql profiler and it returned the correct values. The issue here is that the CaseDS_OPCaseType_4943d10_List_DS lookup its not showing any value and does not apply the developed filter.
This issue happens only in the mini page. I have used this approach in freedom ui form pages and it works fine. Is there something I'm missing?
Kind regards