Custom Web Logic Hooks or custom events

Hi All

Ive used a few Web logic hooks to send data out to our services server but now have the need to do something more custom. I can achieve what i need with a before save and after save hook that can compare fields and then send the data via curl.

I just wandered if this was the best way or is there a way to create a custom trigger event which would make it easier for our sugar admins to manage the web hooks

Also does anyone know where the core functions are that sugar uses when you create a web logic hook, just interested how they do it

Parents Reply Children
  • Hi John

    Regarding your ask about the code, have a look at modules/WebLogicHooks/WebLogicHook.php. It's pretty much self-contained in the class.

    Now, I think you can imagine that there are various ways to achieve what you want, and you can surely do it via an after-save hook, but one approach you alluded to could be viable.

    I'm referring to the definition of a custom event. I've been thinking about custom events lately as they can be an approach to gather related business logic into a finer-grained event instead of something generic like an after-save event. 

    One benefit of the custom event is that you can control when the event should be triggered, which means you can fire it from anywhere like a scheduled job, an API, or even from an orchestrator type after/before save logic-hook. Additionally, you would also be able to pass process variables when triggering the event, which your hook classes would have access to across the event execution.

    Just a thought. 

    I hope it helps.

  • John,
    I won't ask you to check the spam folder for registration email - we've activated your registration, you are welcome to log in to https://logicbuilder.inegroscrm.com now
    please drop me a line if any questions

    Best Regards,
    Dmytro Chupylka

    integroscrm.com
    We make work in Sugar CRM system faster, more convenient and efficient