Hook for afterSave in Lead

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • miwalter
    Junior Member
    • Feb 2016
    • 6

    Hook for afterSave in Lead

    Hi,

    I cannot get my hook to work... maybe someone could be so nice and point me in the right direction?

    I tried making hooks for "Espo\Custom\Hooks\Lead" (in /custom/Espo/Custom/Hooks/Lead) and "Espo\Hooks\Lead" (in /application/Espo/Hooks/Lead) and even tried implementing a Common-Hook to try getting into the save-process. I already tried "Leads" instead of Lead...

    But the only afterSave-"Events" I get (using the Common-Hook) are ScheduledJobLogRecord-Events.

    Is there any other way to do it?

    Regards,
    Mirko
  • alasdaircr
    Active Community Member
    • Aug 2014
    • 525

    #2
    I'm not sure hooks work in custom folder, though could be wrong.

    Either you modify the Crm module, creating a file at application/Espo/Modules/Crm/Hooks/Lead/MyHook.php or create your own module as an extension and provide a hook there.

    Also watch for any errors in the log files.

    Comment

    • alasdaircr
      Active Community Member
      • Aug 2014
      • 525

      #3
      Lead is a Crm module entity so adding the hook into application/Espo/Hooks/Lead would be wrong.

      Comment

      • miwalter
        Junior Member
        • Feb 2016
        • 6

        #4
        Thanks very much, that worked!

        Just for the archive: I put the hook-file into "application/Espo/Modules/Crm/Hooks/Lead". And used the namespace "Espo\Modules\Crm\Hooks\Lead". This works!
        Last edited by miwalter; 02-18-2016, 04:22 PM.

        Comment

        Working...