2

I have added a custom field in admin category. I need to save and get value of my field using observer.

My Xml file is "category_form.xml"

<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
     <fieldset name="display">
         <argument name="data" xsi:type="array">        
             <item name="config" xsi:type="array">
                 <item name="label" xsi:type="string" translate="true">Custom Field</item>
                 <item name="dataScope" xsi:type="string"/>
                 <item name="sortOrder" xsi:type="number">10</item>
                 <item name="collapsible" xsi:type="boolean">true</item>
                 <item name="opened" xsi:type="boolean">true</item>
             </item>
         </argument>
         <field name="display">
            <argument name="data" xsi:type="array">
                <item name="options" xsi:type="object">Vendor\Module\Model\Config\Source\Display</item>
                <item name="config" xsi:type="array">
                    <item name="dataType" xsi:type="string">select</item>
                    <item name="label" translate="true" xsi:type="string">Custom</item>
                    <item name="formElement" xsi:type="string">select</item>
                </item>
            </argument>
        </field> 
    </fieldset>
</form>
  • Can you please post save action code? – Kamlesh Solanki Apr 22 at 11:00
  • Have you created a custom attribute via install data / upgrade data script ? – Shailesh Katarmal Apr 22 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.