Announcement

Collapse
No announcement yet.

How in ORM to receive result of the report on its id

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How in ORM to receive result of the report on its id

    Hello, tell me how to get the ORM result of the report on its id ?

  • #2
    Hello

    Code:
    $reportService = $this->getServiceFactory()->create('Report');
    $reportResult = $reportService->run($id);

    Comment


    • #3
      Returns an error in logs

      <?php

      namespace Espo\Custom\Services;

      use \Espo\ORM\Entity;

      class EntityPlanningService extends \Espo\Core\Services\Base
      {
      public function EntityPlanningServiceAction($workflowId, Entity $entity, array $additionalParameters = null)
      {

      $reportService = $this->getServiceFactory()->create('Report');
      $reportResult = $reportService->run($entity->get('reportId'));

      }
      }


      Espo.ERROR: Uncaught Exception Error: "Call to undefined method Espo\Custom\Services\EntityPlanningService::getSer viceFactory()" at /home/admin/web/*********/public_html/custom/Espo/Custom/Services/EntityPlanningService.php line 12 {"exception":"[object] (Error(code: 0): Call to undefined method Espo\\Custom\\Services\\EntityPlanningService::get ServiceFactory() at /home/admin/web/*********/public_html/custom/Espo/Custom/Services/EntityPlanningService.php:12)"} []

      Comment


      • #4
        Code:
            protected function init()
            {
                parent::init();
                $this->addDependency('serviceFactory');
                ///...
            }
        
            protected function getServiceFactory()
            {
                return $this->injections['serviceFactory'];
            }

        Comment


        • #5
          Thank you very much all earned)

          Comment

          Working...
          X