Announcement

Collapse
No announcement yet.

Modify behaviour of cases module

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

  • Modify behaviour of cases module

    Hi,

    is it possible to override or hook before/after the "actionCreateLink"-method or other of the Cases Module?

    Thanks in advance
    Manuel

  • #2
    Hi
    Look at /application/Espo/ORM/Repositories/RDB.php
    (an example - relation between KnowledgeBaseArticles and Cases (code is in Repositories))

    You can override Repository of Cases

    Comment


    • #3
      Thank you for your reply

      Could you please give an example of how to override the Repository of Cases?

      Comment


      • #4
        custom/Espo/Custom/Repositories/CaseObj.php

        Code:
        namespace Espo\Custom\Repositories;
        
        class CaseObj extends \Espo\Modules\Crm\Repositories
        {
        
        }
        read files I wrote before

        Comment


        • #5
          So i tried this and it works fine with the relation between Cases and KnowledgeBaseArticles, but not with my custom modules.

          Code:
          namespace Espo\Custom\Repositories;
          
          use Espo\ORM\Entity;
          
          class CaseObj extends \Espo\Modules\Crm\Repositories\CaseObj
          {
              public function relate(Entity $entity, $relationName, $foreign, $data = null)
              {
          
              }
          }

          Comment


          • #6
            do not override method relate. Read the file, I sent before.


            $beforeMethodName = 'beforeRelate' . ucfirst($relationName);
            $afterMethodName = 'afterRelate' . ucfirst($relationName);
            $methodName = 'relate' . ucfirst($relationName);

            What the problem is with custom modules?

            Comment


            • #7
              Everything works well with your help.

              The problem with the custom modules was an error that was made by me.

              Thank you very much.

              Comment

              Working...
              X