Logic Hooks Not Working

Logic Hooks are not working. I followed the documents provided by Sugar. Even logs are not generated. 

Please provide code and specify location where files should be added.

Used below location:

custom/Extension/modules/Ext/LogicHooks/logic_hooks.php

custom/modules/Order/logic.php

Version : 10.3 (Enterprise Edition)

  • can you please add the logic and your code sample

    Rodrigo Manara

    Sr. Developer

  • Hi Gautam,

    Please check the below things.

    1.You have to add the definition file in custom/Extension/modules/<modulename>/Ext/LogicHooks/logic_hooks.php where you will define the hook actions that will trigger the logic.

    2.In custom/modules/<modulename>/<yourfilename.php> you have to add your logic file, where you will the original code.

    3.Make sure these files are having the right permissions in the Sugar root directory.

    4.After putting the files in the correct location, you have to perform the Quick Repair and Rebuild to the Sugar Instance.

    If all these things are done correctly, would you mind pasting your files here. So that I can take a look and help to debug the issue.

    Thanks and Regards,

    Poojitha.K

  • it looks like you have an error in the directory path:

    custom/Extension/modules/Ext/Order/LogicHooks/logic_hooks.php

    The rule is as follows:

    Application Logic hooks go in:

    ./custom/Extension/application/Ext/LogicHooks/

    Module  specific logic hooks go in the Extension directory of the specific module:

    ./custom/Extension/modules/<module>/Ext/LogicHooks/

    Francesca

  • Thanks for providing clear understanding and proper steps.

    Logic Hooks are working now. 

    #How we can apply Logic Hooks on custom button ?

    #How we can call Sugar APIs and external APIs  on click of custom button ? 

    It will be great help if you can suggest something here.

  • Followed below approach : 

    1.We need  to add the definition file in .custom/Extension/modules/<modulename>/Ext/LogicHooks/logic_hooks.php where you will define the hook actions that will trigger the logic.

    2.In .custom/modules/<modulename>/<yourfilename.php> you have to add your logic file

    Able to implement logic Hooks.

    #How we can apply Logic Hooks on custom button ?

    #How we can call Sugar APIs and external APIs  on click of custom button ? 

    It will be great help if you can suggest something here.

  • Thanks for the response . Issue got resolved. Followed below suggested steps.

    #How we can apply Logic Hooks on custom button ?

    #How we can call Sugar APIs and external APIs  on click of custom button ? 

    It will be great help if you can suggest something here.

  • Logic hooks are not for custom buttons, they are action driven not user-driven.

    From your many questions, it looks like you are in need of some help familiarizing with the fundamentals of Sugar's architecture.

    I was where you are today and it all felt so muddled...
    The Community is a great place to get help, but it helps a lot if you have the basics.

    Getting to know the concepts and terminology will greatly help with asking the right questions and searching for the right things in the Sugar documentation.

    May I suggest you spend a little time getting more familiar with these courses?

    So many of them are free and I assure you it will help you! Slight smile

    https://sugarclub.sugarcrm.com/learn/

    Welcome to the sweet side of Sugar! 

    FrancescaS

  • Yes sure I will try to spend some time on the link provided. 

    #How we can apply Logic Hooks on custom button ?

    Logic hooks are not for custom buttons, they are action driven not user-driven  >> This is clear. 

    #How we can call Sugar APIs and external APIs  on click of custom button ? >> this query  should have some steps I guess .