I need to create a custom action when an email is recieved to the CRM.
I have crated a workflow for it but I need to set an Action. I see the default actions, but, as mentioned, I need a custom opne to add integration with another platform.
I have created a php file `TestService.php` (for testing purpose) in the `custom/Espo/Custom/Services` directory.
Here is the bare-bones code:
```
<?php
namespace Espo\Custom\Services;
use \Espo\ORM\Entity;
class TestService extends \Espo\Core\Services\Base
{
public function testServiceAction($workflowId, Entity $entity, $additionalParameters = null)
{
//your code here
}
}
```
I also created `Workflow.json` in the `custom/Espo/Custom/Resources/metadata/entityDefs` directory.
like so:
```
{
"serviceActions": {
"Call":{
"testServiceAction": {
"serviceName": "TestService",
"methodName": "testServiceAction"
}
}
}
}
```
i also added a translation for en_US
```
{
"serviceActions": {
"testServiceAction": "Label for TestServiceAction"
}
}
```
After cleaning the cache, i went to admin panel > workflow > my created workflow.
I go to action section, click the + button and i dont see my created action.
even when selecting `run service action`, the dropdown list is empty
I folowed this tutorial: https://www.espocrm.com/features/add...-for-workflow/
I also tried by this tutorial: https://docs.espocrm.com/development...rvice-actions/
But both did not work. what am i missing?
I have crated a workflow for it but I need to set an Action. I see the default actions, but, as mentioned, I need a custom opne to add integration with another platform.
I have created a php file `TestService.php` (for testing purpose) in the `custom/Espo/Custom/Services` directory.
Here is the bare-bones code:
```
<?php
namespace Espo\Custom\Services;
use \Espo\ORM\Entity;
class TestService extends \Espo\Core\Services\Base
{
public function testServiceAction($workflowId, Entity $entity, $additionalParameters = null)
{
//your code here
}
}
```
I also created `Workflow.json` in the `custom/Espo/Custom/Resources/metadata/entityDefs` directory.
like so:
```
{
"serviceActions": {
"Call":{
"testServiceAction": {
"serviceName": "TestService",
"methodName": "testServiceAction"
}
}
}
}
```
i also added a translation for en_US
```
{
"serviceActions": {
"testServiceAction": "Label for TestServiceAction"
}
}
```
After cleaning the cache, i went to admin panel > workflow > my created workflow.
I go to action section, click the + button and i dont see my created action.
even when selecting `run service action`, the dropdown list is empty
I folowed this tutorial: https://www.espocrm.com/features/add...-for-workflow/
I also tried by this tutorial: https://docs.espocrm.com/development...rvice-actions/
But both did not work. what am i missing?
Comment