0

How does fieldset.xml work and when to use it?

0

To check with below example to how its work.

I have created a custom model to create order from quote; I am using fieldset.xml to copy quote custom codes to order. I have created custom columns in both quote and order with matching fields. When order is placed values are storing in quote custom fields but not copying to order. Below is my fieldset.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="urn:magento:framework:DataObject/etc/fieldset.xsd">
<scope id="global">
    <!--quote convert to order-->
    <fieldset id="sales_convert_quote">            
        <field name="preorder_number">
            <aspect name="to_order" />
        </field>
        <field name="purchase_order_number">
            <aspect name="to_order" />
        </field>
        <field name="reference_number">
            <aspect name="to_order" />
        </field>
    </fieldset>
    <!--quote item convert to order item-->
    <fieldset id="quote_convert_item">
        <field name="preorder_number">
            <aspect name="to_order_item" />
        </field>
        <field name="purchase_order_number">
            <aspect name="to_order_item" />
        </field>
        <field name="reference_number">
            <aspect name="to_order_item" />
        </field>
    </fieldset>
</scope>
  • Are the fields copied automatically? – vitoriodachef Jun 21 at 13:20

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.