Disable customer attribute in the Magento admin form

You need to create Namespace/Module/view/base/ui_component/customer_form.xml and add the following 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”>

        <fieldset name=”customer”>

            <field name=”attribute name”>

                <argument name=”data” xsi:type=”array”>

                    <item name=”config” xsi:type=”array”>

                        <item name=”disabled” xsi:type=”boolean”>true</item>

                    </item>

                </argument>

            </field>

    </fieldset>

</form>

Leave a comment

Your email address will not be published. Required fields are marked *