0

Magento Customer Grid Custom attribute can't export csv and export xml, Showing error, how to add custom attributes to the customer export.

PHP Fatal error: Uncaught TypeError: Argument 2 passed to Magento\Framework\View\Element\UiComponentFactory::argumentsResolver() must be of the type array, null given, called in /var/www/Magento/vendor/magento/framework/View/Element/UiComponentFactory.php on line 220 and defined in /var/www/Magento/vendor/magento/framework/View/Element/UiComponentFactory.php:172\nStack trace:\n#0 /var/www/Magento/vendor/magento/framework/View/Element/UiComponentFactory.php(220): Magento\Framework\View\Element\UiComponentFactory->argumentsResolver('customer_clv', NULL)\n#1 /var/www/Magento/vendor/magento/module-ui/Component/Listing/Columns/Column.php(77): Magento\Framework\View\Element\UiComponentFactory->create('customer_clv', 'decimal', Array)\n#2 /var/www/Magento/vendor/magento/module-ui/Component/MassAction/Filter.php(182): Magento\Ui\Component\Listing\Columns\Column->prepare()\n#3 /var/www/Magento/vendor/magento/module-ui/Component/MassAction/Filter.php(180): Magento\Ui\Component\MassAction\Filte in /var/www/Magento/vendor/magento/framework/View/Element/UiComponentFactory.php on line 172, referer:

customer_listing.xml file containd below code.

<?xml version="1.0" encoding="UTF-8"?> <!-- /**  * Copyright © Ourmodule. All rights reserved.  *  */
--> <listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <columns name="customer_columns" class="Magento\Customer\Ui\Component\Listing\Columns">

        <column name="customer_clv" class="Ourmodule\Customer\Ui\Component\Listing\Column\Customerclv">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="filter" xsi:type="boolean">true</item>
                    <item name="sorting" xsi:type="string">asc</item>
                    <item name="sortable" xsi:type="boolean">true</item>
                    <item name="editor" xsi:type="string">text</item>
                    <item name="label" xsi:type="string" translate="true">Customer Lifetime Value</item>
                    <item name="sortOrder" xsi:type="number">81</item>
                </item>
            </argument>
        </column>
        <column name="predicted_average_profit" class="Ourmodule\Customer\Ui\Component\Listing\Column\Customerclv">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="filter" xsi:type="boolean">true</item>
                    <item name="sorting" xsi:type="string">asc</item>
                    <item name="sortable" xsi:type="boolean">false</item>
                    <item name="editor" xsi:type="string">text</item>
                    <item name="label" xsi:type="string" translate="true"> Transaction Value</item>
                    <item name="sortOrder" xsi:type="number">82</item>
                </item>
            </argument>
        </column>
        <actionsColumn name="actions" class="Ourmodule\Customer\Ui\Component\Listing\Column\ClvActions">
            <settings>
                <indexField>entity_id</indexField>
            </settings>
        </actionsColumn>        

    </columns> </listing>
  • For this, first you need to display your custom_attribute in customer listing. after that when you export it will include that new filed. – Ramkishan Suthar Nov 28 '18 at 10:08
  • I have added customer listing xml updated question – Naveenbos Nov 28 '18 at 10:21
  • @RamkishanSuthar do yo u have nay idea about this? – Naveenbos Nov 28 '18 at 11:03
  • I just know that you need to add that attribute in listing then it will include in your csv. Magento includes only those fields which are in visible in grid. – Ramkishan Suthar Nov 28 '18 at 11:11
  • @RamkishanSuthar so do I have to correct my customer_listing.xml file? for export functionality – Naveenbos Nov 28 '18 at 11:13

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.