Results 1 to 5 of 5

Thread: Which (if any) logic hooks fire when a report is run?

  1. #1
    tobydz is offline Sugar Community Member
    Join Date
    Mar 2011
    Location
    Las Vegas, NV
    Posts
    144

    Default Which (if any) logic hooks fire when a report is run?

    I'm implementing some new code that sets a date on a module record based on the newest note created on that record. Doing a "Mass Update" isn't an option for me (long story, short ending), so, if there's a logic hook that will fire when I run the report to pull those values, that would save me from "touching" each file to populate this date field.

    Would 'after_retrieve' or 'process_record' fire off during a report query?

    Thoughts? Suggestions?
    Last edited by tobydz; 2012-01-31 at 09:04 PM. Reason: added more info

  2. #2
    tobydz is offline Sugar Community Member
    Join Date
    Mar 2011
    Location
    Las Vegas, NV
    Posts
    144

    Default Re: Which (if any) logic hooks fire when a report is run?

    So far I've tested both 'process_record' and 'after_retrieve'.... neither of them seem to fire off when running a report.....

  3. #3
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Which (if any) logic hooks fire when a report is run?

    There is no logic hook loaded at Report context.
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  4. #4
    christianknoll's Avatar
    christianknoll is offline Sugar Community Member
    Join Date
    Nov 2008
    Location
    Vienna
    Posts
    939

    Default Re: Which (if any) logic hooks fire when a report is run?

    Sugar does not fire hooks on loading a report. You can use our KINAMU Reporter to achieve what you are looking for. In our Reporter (also in the free basic edition) )you can create a KReporter field which is a non db field you can use to e.g. run a subquery in the report.

    One of our customer is doing a similar task with this where they run a report on accounts and then have defined one field that shows the last date of either a call, meeting or email that was sent to that account. This is purely evaluated at the report runtime and thus a clean and safe approach.

    Alternatively you can also embed custom functions or even custom php code on the report that gets evaluated before the output is processed if you need logic to be performed past the SQL.

    christian.

    Quote Originally Posted by tobydz View Post
    I'm implementing some new code that sets a date on a module record based on the newest note created on that record. Doing a "Mass Update" isn't an option for me (long story, short ending), so, if there's a logic hook that will fire when I run the report to pull those values, that would save me from "touching" each file to populate this date field.

    Would 'after_retrieve' or 'process_record' fire off during a report query?

    Thoughts? Suggestions?

  5. #5
    tobydz is offline Sugar Community Member
    Join Date
    Mar 2011
    Location
    Las Vegas, NV
    Posts
    144

    Default Re: Which (if any) logic hooks fire when a report is run?

    Quote Originally Posted by andopes View Post
    There is no logic hook loaded at Report context.
    Yeah so I guess my workaround is going to be using the process_record hook (which fires off in list views) and just page through the records to perform the updates. I know it's dirty, but at least this way it'll get my new code to kick in *before* the reports are run.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Will a timeout fire logout logic hooks?
    By Sryalls in forum Developer Help
    Replies: 1
    Last Post: 2011-08-25, 07:51 PM
  2. help to fire logic hooks
    By massimo78 in forum Developer Help
    Replies: 3
    Last Post: 2010-04-13, 07:11 AM
  3. Fire off logic hooks after save
    By wdroush in forum Developer Help
    Replies: 4
    Last Post: 2010-03-23, 04:00 PM
  4. fire logic hook after duplicate value has been resolved
    By ServerStorm in forum Developer Help
    Replies: 0
    Last Post: 2009-02-04, 05:14 PM
  5. logic hooks fire only when sub-panel action is initiated
    By ServerStorm in forum Developer Help
    Replies: 6
    Last Post: 2008-10-24, 05:46 AM

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
  •