To fix this issue, we need to create ‘controller.php’ file at the below location.
appcodeMagemonkeysCustomerControllerIndex
<?php
Namespace MagemonkeysCustomerControllerIndex;
class Controller extends MagentoFrameworkAppActionAction
{
protected $customer;
protected $customerFactory;
public function __construct(
MagentoCustomerModelCustomer $customer
MagentoCustomerModelResourceModelCustomerFactory $customerFactory
)
{
$this->customer = $customer;
$this->customerFactory = $customerFactory;
}
public function execute()
{
$custom = $this->_customerFactory ->create();
$custom = $custom->setWebsiteId($helperData->getWebsiteId());
$custom = $custom->loadByEmail("jayesh@webtechsystem.com");
$custom->setCustomAttributeCode(custom attribute value);
// Main code to resolve this issue.
$customerData = $custom->getDataModel();
$customerData->setCustomAttribute('custom_attribute_code', 'custom attribute value');
$custom->updateData($customerData);
$custom->save();
}
}

