Hello!
After updating Espo and the Module, this workflow stopped working normally. How to fix it? Because of what is it? Before the upgrade, it worked.
I have a lot of worker threads working on the basis of Service Action.
After updating Espo and the Module, this workflow stopped working normally. How to fix it? Because of what is it? Before the upgrade, it worked.
I have a lot of worker threads working on the basis of Service Action.
PHP Code:
<?php
namespace Espo\Custom\Services;
use \Espo\ORM\Entity;
class SetRelationFeld extends \Espo\Core\Services\Base
{
public function setRelationFeldAction($workflowId, Entity $entity, array $additionalParameters = null)
{
$opportunity = $this->getEntityManager()->getEntity($entity->get('parentType'), $entity->get('parentId'));
$saveStage = $opportunity->get('stage');
$arrayStage = array("New" ,"Diagnostics","Repairs","Searchdetails","CoordinationClient","WaitPrePaid","PurchaseDetails");
if (in_array($saveStage,$arrayStage)){
$stage = "Waiting Parts";
if ($opportunity) {
$opportunity->set(array('stage'=>$stage));
$this->getEntityManager()->saveEntity($opportunity, array('skipWorkflow' => true));
}
}
}
}
?>
Comment