0

I have added the column transaction_id to my sales_order_invoice_grid.

Vendor\Module\etc\adminhtml\di.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <virtualType name="Magento\Sales\Model\ResourceModel\Order\Invoice\Grid">
        <arguments>
            <argument name="columns" xsi:type="array">
                <item name="transaction_id" xsi:type="string">
                    sales_invoice.transaction_id
                </item>
            </argument>
        </arguments>
    </virtualType>
</config>

Vendor\Module\view\adminhtml\ui_component\sales_order_invoice_grid.xml

<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <columns name="sales_order_invoice_columns">
        <column name="transaction_id">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="filter" xsi:type="string">text</item>
                    <item name="label" xsi:type="string" translate="true">Transaction ID</item>
                </item>
            </argument>
        </column>
    </columns>
</listing>

The header of the column appears as expected in the sales_order_invoice_grid and also in the CSV export file, which can be generated on this page.
The problem is the values are missing. enter image description here

Can anyone say what I am missing or what could be wrong?
Thanks

0

The column in the sales_invoice_grid table was missing. Now it is working.

<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
    <table name="sales_invoice_grid" resource="sales" engine="innodb">
        <column xsi:type="varchar" name="transaction_id" length="255" unsigned="false" nullable="true" identity="false"
                comment="Transaction ID"/>
    </table>
</schema>

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.