Logic hooks in SuiteCRM 8.7.1

I’m trying to make a logic hook that sets a field on a contact after it is created. However, I cannot get it to work. Nothing happens and there are no errors reported.

I’m following this guide: Logic Hooks :: SuiteCRM Documentation

Does it not work for SuiteCRM 8?

It seems like the logic hook is not registered at all. Can I somehow see what logic hooks that are registered on the Contacts?

Thanks.

Did you do Quick Repair & Rebuild from Admin panel?

Also, you may need to clean symfony cache.

Check log files for errors under /public/legacy/

I’ve done it a million times where I:

  1. name the file wrong (does not match what’s in the hook)
  2. Put the file hook file in wrong directory
  3. put the actual file in the wrong directory or does not match the path in the hook
  4. The class and method called in the hook don’t match the actual class and method in the file.

(Also don’t forget to repair and rebuild)

If the above 4 things check out, then check file permissions. Perhaps the hook file isn’t running due to SuiteCRM doesn’t have permission to run it.

Thanks for your help!

I had to put the files under the “legacy” subfolders. I don’t think I saw that documented anywhere. But not it is working :slightly_smiling_face:

Yeah, they should mentioned that in the v8.x doc