Hi I want to add a custom field in Product add/Edit form using UiComponent and want to save its value and displayed back to form as well
I have read a couple of threads for this - but not getting the exact solution
I have added custom field using uicomponent in product_form.xml file below is the code :
<?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">
<modal name="advanced_inventory_modal">
<fieldset name="manage_note">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="label" xsi:type="string" translate="true">Manage Note</item>
<item name="dataScope" xsi:type="string"/>
<item name="sortOrder" xsi:type="number">0</item>
<item name="collapsible" xsi:type="boolean">true</item>
<item name="opened" xsi:type="boolean">true</item>
</item>
</argument>
<field name="note">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="label" xsi:type="string" translate="true">Notes</item>
<item name="formElement" xsi:type="string">textarea</item>
<item name="dataScope" xsi:type="string">quantity_and_stock_status.note</item>
<item name="sortOrder" xsi:type="number">1</item>
<item name="scopeLabel" xsi:type="string">[GLOBAL]</item>
</item>
</argument>
</field>
</fieldset>
<fieldset name="stock_data">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="label" xsi:type="string" translate="true">Stock Configuration</item>
<item name="dataScope" xsi:type="string"/>
<item name="sortOrder" xsi:type="number">100</item>
<item name="collapsible" xsi:type="boolean">true</item>
</item>
</argument>
</fieldset>
</modal>
</form>
Custom Field is added successfully, but its value is not getting saved ? due to that its value is not displayed in edit form as well.
so what is the best approach to achieve this?