PCF Dataset component not filtering correctly

282 Views Asked by At

I'm currently developing a dataset PCF in which I use multiple datasets.

The first dataset is the one that is bound to the view i'm applying the PCF.
The two others are datasets configured to search on additional tables.

The users are not able to manipulate which columns are displayed. To add the columns I need on the datasets, I load them in the init function of the component by using this line of code (which works) :

context.parameters.<dataset1_name>.addColumn('table1_field');
context.parameters.<dataset2_name>.addColumn('custom_table2_field');

The problem is that, when I'm using the component on a view (home page or sub-grid), if I'm trying to apply additional filtering by using native fields (as shown below), I get an error.

Screenshot filter zone

If I'm looking on the browser network debugger, I see that dynamics include wrong fields in the generated fetchXml, for example :

<fetch>
    <entity name="table1">
        <attribute name="table1_field" />
        <attribute name="custom_table2_field" />  <!-- This field is not part of table1 but it's automatically added in the fetch :( -->
        
        <filter>
            ...
        </filter>
    </entity>
</fetch>

Please not that, if i'm not adding columns to the additional datasets, I won't get the error.

Also, if I'm designing a filter in the view designer, it seems to work without problem. But if I'm modifying the filter at runtime, **** happens.

Do you know why the model-drive app does this ?
Is there a way to tell the program that I just want the first dataset to be filtered ?

For the filtering, I want to keep the out of the box tools and not develop a custom filter section.

0

There are 0 best solutions below