0

I have to create two grid customers filtred according to group so i have created my own grid but i have this error :SQLSTATE[42S22]: Column not found: 1054 Unknown column 'billing_telephone' in 'order clause', query was: SELECT main_table.* FROM customer_entity AS main_table ORDER BY billing_telephone ASC. here is my code client_local_listing.xml:

<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<!-- Integration -->
<argument name="data" xsi:type="array">
    <item name="js_config" xsi:type="array">
        <!-- we define a provider -->
        <item name="provider" xsi:type="string">client_local_listing.client_local_listing_data_source</item>
        <!-- same string as above -->
        <item name="deps" xsi:type="string">client_local_listing.client_local_listing_data_source</item>
    </item>
</argument>
<!-- Data source -->
<dataSource name="client_local_listing_data_source">
    <argument name="dataProvider" xsi:type="configurableObject">
        <argument name="class" xsi:type="string">LocalGridDataProvider</argument> <!-- Data provider class -->
        <argument name="name" xsi:type="string">client_local_listing_data_source</argument> <!-- provider defined above -->
        <argument name="primaryFieldName" xsi:type="string">entity_id</argument> <!-- Primary key -->
        <argument name="requestFieldName" xsi:type="string">id</argument> <!-- URL name parameter -->

        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="component" xsi:type="string">Magento_Ui/js/grid/provider</item>
                <item name="update_url" xsi:type="url" path="mui/index/render"/>
                <item name="storageConfig" xsi:type="array">
                    <!-- Primary key column name -->
                    <item name="indexField" xsi:type="string">entity_id</item>
                </item>
            </item>
        </argument>
    </argument>
</dataSource>
<!-- Container Listing Top -->
<container name="listing_top">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="template" xsi:type="string">ui/grid/toolbar</item>
        </item>
    </argument>
    <!-- Button to manage views -->
    <bookmark name="bookmarks">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="component" xsi:type="string">Magento_Ui/js/grid/controls/bookmarks/bookmarks</item>
                <item name="displayArea" xsi:type="string">dataGridActions</item>
                <item name="storageConfig" xsi:type="array">
                    <item name="saveUrl" xsi:type="url" path="mui/bookmark/save"/>
                    <item name="deleteUrl" xsi:type="url" path="mui/bookmark/delete"/>
                    <item name="namespace" xsi:type="string">client_local_listing</item>
                </item>
            </item>
        </argument>
    </bookmark>
    <!-- Button to manage columns -->
    <container name="columns_controls">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="columnsData" xsi:type="array">
                    <item name="provider" xsi:type="string">client_local_listing.client_local_listing.client_local_columns</item>
                </item>
                <item name="component" xsi:type="string">Magento_Ui/js/grid/controls/columns</item>
                <item name="displayArea" xsi:type="string">dataGridActions</item>
            </item>
        </argument>
    </container>
</container>


<columns name="client_local_columns" class="Magento\Customer\Ui\Component\Listing\Columns">

    <selectionsColumn name="ids" sortOrder="10">
        <settings>
            <indexField>entity_id</indexField>
        </settings>
    </selectionsColumn>
    <column name="entity_id" sortOrder="20">
        <settings>
            <filter>textRange</filter>
            <label translate="true">ID</label>
            <sorting>asc</sorting>
        </settings>
    </column>
    <column name="name" sortOrder="30">
        <settings>
            <filter>text</filter>
            <label translate="true">Name</label>
        </settings>
    </column>
    <column name="email" sortOrder="40">
        <settings>
            <filter>text</filter>
            <editor>
                <editorType>text</editorType>
            </editor>
            <label translate="true">Email</label>
        </settings>
    </column>




    <column name="dob" class="Magento\Ui\Component\Listing\Columns\Date" component="Magento_Ui/js/grid/columns/date" sortOrder="170">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="componentDisabled" xsi:type="boolean">true</item>
            </item>
        </argument>
        <settings>
            <timezone>false</timezone>
            <dateFormat>MMM d, y</dateFormat>
            <skipTimeZoneConversion>true</skipTimeZoneConversion>
            <filter>dateRange</filter>
            <dataType>date</dataType>
            <label translate="true">Date of Birth</label>
            <visible>false</visible>
        </settings>
    </column>







</columns>

and the code of my di.xml:

<?xml version="1.0"?>

Magento\Customer\Model\Resource\Collection LocalGridFilterPool

<!-- Create our type DepartmentGridFilterPool -->
<virtualType name="LocalGridFilterPool" type="Magento\Framework\View\Element\UiComponent\DataProvider\FilterPool">
    <arguments>
        <argument name="appliers" xsi:type="array">
            <item name="regular" xsi:type="object">Magento\Framework\View\Element\UiComponent\DataProvider\RegularFilter</item>
            <item name="fulltext" xsi:type="object">Magento\Framework\View\Element\UiComponent\DataProvider\FulltextFilter</item>
        </argument>
    </arguments>
</virtualType>

<!-- Type for jobs_department_listing_data_source -->
<type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
    <arguments>
        <argument name="collections" xsi:type="array">
            <item name="client_local_listing_data_source" xsi:type="string">Magento\Customer\Model\ResourceModel\Grid\Collection</item>
        </argument>
    </arguments>
</type>

<!-- Simulate our class Maxime\Jobs\Model\ResourceModel\Grid\Department\Collection -->
<virtualType name="Magento\Customer\Model\ResourceModel\Grid\Collection" type="Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult">
    <arguments>
        <argument name="mainTable" xsi:type="string">customer_entity</argument>
        <argument name="resourceModel" xsi:type="string">Magento\Customer\Model\ResourceModel\Customer</argument>
    </arguments>
</virtualType>

please help me i am really lost and how to filter with group_id please

  • do i have to override a collection or what ?? because when i searched for this colunm under vendor/magento/Module_customer i foound this billing_telephone under CustomerRepository.php but why i am getting this error – Developper Magento Nov 21 '18 at 9:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.