1

I have created custom module for creating custom attribute in Magento2. I installed a custom module in local system there is working fine.

My Local Magento version is 2.1.6, I installed this custom module in Production environment and it doesn't work.

The Production Magento version is 2.2.3 custom attribute is showing in eav_attribute table but, not showing in admin dashboard !

eav attibute table shows custom attribute:

enter image description here

3
  • did you try php bin/magento index:reindex ?
    – Keyur Shah
    May 1, 2018 at 19:43
  • yes i have run this command
    – pramod24
    May 1, 2018 at 19:44
  • Did this module is compatible with the both versions ?
    – PЯINCƎ
    May 1, 2018 at 21:46

1 Answer 1

2

priviously my code is

$magentoUuidAttribute = $customerSetup->getEavConfig()
    ->getAttribute(Customer::ENTITY, 'uuid');
$magentoUuidAttribute->addData([
    'attribute_set_id' => $attributeSetId,
    'attribute_group_id' => $attributeGroupId,
    'used_in_forms' => ['adminhtml_customer'],
 ]);

It seem to be visible only when there full 4 opitons of 'used_in_forms' 'customer_account_create', 'customer_account_edit', 'checkout_register', 'adminhtml_customer' . Don't worry because even when you set this

  $magentoUuidAttribute = $customerSetup->getEavConfig()
->getAttribute(Customer::ENTITY, 'uuid');
 $magentoUuidAttribute->addData([
'attribute_set_id' => $attributeSetId,
'attribute_group_id' => $attributeGroupId,
'used_in_forms' => ['adminhtml_customer','adminhtml_customer_address','customer_account_edit','customer_address_edit','customer_register_address','adminhtml_checkout'],
 ]);

Now admin panel showing custom attribute.

1
  • I had exactly the same issue. Thanks for your sharing. What do the adminhtml_customer option exactly? Mar 1, 2019 at 13:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.