Magento 2 – Custom Field in Form Not Saving Values to DB

adminformmagento2uicomponent

I have added custom field to admin form using Ui Component.

Here is the XML to add field

<field name="all_keywords">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="dataScope" xsi:type="string">all_keywords</item>
            <item name="label" xsi:type="string" translate="true">All Keywords</item>
            <item name="dataType" xsi:type="string">text</item>
            <item name="formElement" xsi:type="string">input</item>
            <item name="source" xsi:type="string">all_keywords</item>
            <item name="validation" xsi:type="array">
                <item name="required-entry" xsi:type="boolean">true</item>
            </item>
            <item name="sortOrder" xsi:type="number">25</item>
        </item>
    </argument>
</field>

Field is displayed properly and it's showing data if I modified from db. Button on click on save button data not storing in db. I can see data in controller in post.

Best Answer

I have found issue. actually it was custom paid module so i can't share code here. but they have used magento2's Api where they are defining set and get method for all field.

I thought to post this because it can help to other as well.

Related Topic