Show notification that a logic hook triggered

I need to show a notification that some fields were automatically updated by a logic hook.

When saving an account or contact, it checks for certain flags to be set across all contacts. If it is the only contact attached to an account, the flags get set automatically.

This behaviour is sometimes unexpected when in the contact view, because the flags get set on save, but the reason is not obvious. How do I show a popup notification (similar to error/success messages) when the flags have been set?

Parents Reply Children
  • Derick van Niekerk

    If you only want to check your logic hook is trigger or not for this no need of any notification,  you can check it using GLOBALS log to do so:

    $GLOBALS['log']->fatal("My Logic hook is triggered");
    $GLOBALS
    ['log']->fatal("More results " . print_r($beans, True));

    Put the above line in your logic hook and once saving of record is done, then check it in sugarcrm.log file.

    If your logic hook executed then you are able to see your log message " My Logic hook is triggered" & also it will print all your $beans values. I think this is the only way we can get.

    Let me know for further Help.

    Best Regards

    S Ramana Raju

  • The logic hook is triggered and works well but logging does not help to notify a current user about the actions taken. 

    SugarApplication::appendErrorMessage() seems to be what I'm looking for because it would display a message to the current user... Unfortunately it doesn't display anything. I want a notice to display on the screen to tell the user what the logic hook just did. Otherwise flags seem to reset themselves and no reason is given. It is unlikely that an end user would notice the logs

    Derick