Results 1 to 4 of 4

Thread: Logic Hook for All Modules

  1. #1
    chadhutchins is offline Junior Member
    Join Date
    Dec 2011
    Posts
    7

    Default Logic Hook for All Modules

    I'm working on a logic hook that needs to be fired each time any record of any module is modified. Instead of creating a logic hook entry for each and every module in a sugar instance, is there a better way to go about implementing this functionality (doesn't necessarily have to be a logic hook)?

    It'd probably be possible to write some code to programmatically add all of the logic hooks to all of the modules in the system, but then you'd have to handle the case where new modules are added to the system.

    Another thought was use an application hook and check the module and action each time it gets fired, but all 3 of the application logic hooks seem to be UI focused and not run when non-UI things are run (such as API calls).

    Any ideas?

    Thanks!

  2. #2
    Angel's Avatar
    Angel is offline Sugar Community Member
    Join Date
    Jul 2005
    Location
    Los Angeles
    Posts
    4,813

    Default Re: Logic Hook for All Modules

    I remember interacting with an instance once that had a logic_hooks file in custom/modules, I was busy checking out other things on it, so I am not sure what purpose it served (if any), but I suppose it is worth a shot.

    One thing I would caution you on, given the number of cogs that will be moving, is to make sure that the file containing your custom code uses a unique class name, especially if you have more than one file to implement.
    Regards,

    Angel Magaņa
    Co-Author: Implementing SugarCRM 5.x (Packt Publishing -- Sept. 2010)
    Blog: http://cheleguanaco.blogspot.com.
    Twitter: @cheleguanaco.

    ________
    | Projects: |_____________________________________
    |
    | CandyWrapper (.NET Wrapper for SugarCRM SOAP API). Source now available on GitHub!
    | GoldMine to SugarCRM Express Conversion. Latest: 1.0.1.7 (Nov. 3, 2009)
    | CRM SkyDialer (Skype Integration). Latest: 1.0.2 (Feb. 17, 2010)
    | Round Robin Leads Assignment
    | Phone Number Formatter
    | CaseTwit (Twitter Integration)
    ______________________________________________

  3. #3
    chadhutchins is offline Junior Member
    Join Date
    Dec 2011
    Posts
    7

    Default Re: Logic Hook for All Modules

    That works. Thanks for the advice!

  4. #4
    Angel's Avatar
    Angel is offline Sugar Community Member
    Join Date
    Jul 2005
    Location
    Los Angeles
    Posts
    4,813

    Default Re: Logic Hook for All Modules

    Cool! Thanks for closing the loop, got me out of my curiosity.
    Regards,

    Angel Magaņa
    Co-Author: Implementing SugarCRM 5.x (Packt Publishing -- Sept. 2010)
    Blog: http://cheleguanaco.blogspot.com.
    Twitter: @cheleguanaco.

    ________
    | Projects: |_____________________________________
    |
    | CandyWrapper (.NET Wrapper for SugarCRM SOAP API). Source now available on GitHub!
    | GoldMine to SugarCRM Express Conversion. Latest: 1.0.1.7 (Nov. 3, 2009)
    | CRM SkyDialer (Skype Integration). Latest: 1.0.2 (Feb. 17, 2010)
    | Round Robin Leads Assignment
    | Phone Number Formatter
    | CaseTwit (Twitter Integration)
    ______________________________________________

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 2011-10-13, 04:40 PM
  2. Replies: 10
    Last Post: 2010-11-16, 02:41 AM
  3. Logic Hook Help please
    By monicaDC in forum Developer Help
    Replies: 1
    Last Post: 2010-02-01, 08:19 PM
  4. Replies: 3
    Last Post: 2009-08-15, 03:00 AM
  5. Can I do this with a logic hook?
    By daerid in forum Developer Help
    Replies: 2
    Last Post: 2008-04-23, 05:49 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •