How resolve Custom Filter issue

137 Views Asked by At

I have create a report in myExtension-items-core.xml (that run a query where the condition is : "WHERE {bs.uid} in (?baseStorePk)") and I add a custom filter (BaseStore) in AdvancedSearch of an entity. Now when I click on button search (after choose the baseStore) I have this error in the log.enter image description here

enter image description here

The method into AdvancedSearchController:

public void myAddFilterQueryRawCondition ( final AdvancedSearchData searchData, final List models)
{
if (CollectionUtils.isNotEmpty(models) && models.stream().noneMatch(x -> !(x instanceof BaseStoreModel)))
{
        List<String> baseStorePk = ((List<BaseStoreModel>) models).stream()
                .map(bs -> bs.getUid())
                .collect(Collectors.toList());

        FieldType fieldType = new FieldType();
        fieldType.setDisabled(Boolean.TRUE);
        fieldType.setSelected(Boolean.TRUE);
        fieldType.setName("baseStorePk");

        searchData.addFilterQueryRawCondition(fieldType, ValueComparisonOperator.IN, baseStorePk);

    }
}
0

There are 0 best solutions below