A merchant tasked you to add an input field for notes to the Customer Account Information backend page.
Which three actions do you specify in a module’s Data Patch to add a customer notes attribute? (Choose three.)
A. $cache->clean([‘eav’, ‘db_ddl’]);
B. $customerSetup->addAttribute(‘customer’, ‘notes’, $options);
C. $customerSetup->getConnection()->addColumn(‘customer_entity’, ‘notes’, $columnSpecs);
D. $notesAttribute->setData(‘used_in_forms’, [‘adminhtml_customer’]);
E. $customerSetup->addAttributeToSet(‘customer’, $attributeSetIdCustomer, $groupId, ‘notes’);
Answer: B D E
I agree with B,D and E as what an example provided on the link.
I would say B,D, E as right answer.
Ref: https://meetanshi.com/blog/create-custom-customer-attribute-in-magento-2/
This is a really odd question…
You would only need to use get connection to start like: C $this->moduleDataSetup->getConnection()->startSetup();
B is a given $customerSetup->addAttribute()
D is used to specify that its used in the admin $notesAttribute->setData(‘used_in_forms’, [‘adminhtml_customer’]); Once its been added.
Ive never used either E or A. Id go for A because the ddl cache is a thing https://devdocs.magento.com/guides/v2.4/config-guide/cli/config-cli-subcommands-cache.html
So i reckon like it says ABD is correct