0

I'm trying to customize MSI Order shipping source selection page (the step before shipment creation form). I need to add a column in "ordered items" dynamic rows.

I was able to add my new column, but I can't populate it with my custom attribute's value.

app/code/Company/InventoryShippingAdminUi/view/adminhtml/ui_component/inventory_shipping_source_selection_form.xml :

<?xml version="1.0" encoding="UTF-8"?>
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <fieldset name="items_ordered">
        <dynamicRows name="items">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="map" xsi:type="array">
                        <item name="solsysId" xsi:type="string">solsysId</item>
                    </item>
                </item>
            </argument>
            <container name="record">
                <field name="solsysId" formElement="input" sortOrder="15">
                    <settings>
                        <elementTmpl>ui/form/element/html</elementTmpl>
                        <dataType>text</dataType>
                        <dataScope>solsysId</dataScope>
                        <label translate="true">Solsys ID</label>
                        <labelVisible>false</labelVisible>
                    </settings>
                </field>
            </container>
        </dynamicRows>
    </fieldset>
</form>

I'm not sure about the map part. solsys_id is an extension attribute for Magento\Sales\Api\Data\OrderItemInterface added via plugin on Magento\Sales\Api\OrderItemRepositoryInterface repository (afterGet, afterGetList). I think that maybe this repository is not used to populate the dynamic rows component. If so, I cannot figure how to provide solsys_id to this component...

Magento devdocs page about dynamic rows was not helpful and I couldn't find help resource anywhere.

Any help (even a tutorial link) will be appreciated !

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.