- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Getting error "No such entity with id =" in admin company edit
Getting error No such entity id = in b2b Company Edit
_construct/var/www/html/Project/vendor/magento/module-company/Model/CompanyRepository.php:83 - singleField/var/www/html/Project/vendor/magento/framework/Interception/Interceptor.php:58 - get/var/www/html/Project/vendor/magento/framework/Interception/Interceptor.php:138
it's showing problems in this line throw NoSuchEntityException::singleField('id', $companyId);
if (!$company->getId()) {
throw NoSuchEntityException::singleField('id', $companyId);
}
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Getting error "No such entity with id =" in admin company edit
Hi @karuna_khatri,
Greetings!
Can you please tell me that which B2B company extension you are using and which Magento version you are using? This will help us to solve your issue.
Awaiting your response.
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Getting error "No such entity with id =" in admin company edit
Can anyone help me solve this? We are now getting this error suddenly when trying to save a company.
2025-01-20T22:47:27+00:00 INFO (6): Phrase: No such entity with id = 1 2025-01-20T22:47:27+00:00 INFO (6): /var/www/html/vendor/magento/framework/Exception/NoSuchEntityException.php:78 - __construct 2025-01-20T22:47:27+00:00 INFO (6): /var/www/html/vendor/magento/framework/Exception/NoSuchEntityException.php:78 - __construct/var/www/html/vendor/magento/module-company/Model/CompanyRepository.php:82 - singleField
public function get($companyId)
{
if (!isset($this->instances[$companyId])) {
/** @var Company $company */
$company = $this->companyFactory->create();
$company->load($companyId);
if (!$company->getId()) {
throw NoSuchEntityException::singleField('id', $companyId);
}
$this->instances[$companyId] = $company;
}
return $this->instances[$companyId];
}