Results 1 to 8 of 8

Thread: Logic Hooks and Worflows

  1. #1
    planetcaravan is offline Sugar Community Member
    Join Date
    May 2011
    Posts
    32

    Default Logic Hooks and Worflows

    Hi there,

    I'm a newbie on SugarCRM and I bought the companion guide.
    I have a question about Logic Hooks and Worflows.
    It is right to say that in CE of SugarCRM process are managed by Logic Hooks and in PRO edition with Workflows?

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

    Default Re: Logic Hooks and Worflows

    All SugarCRM flavors supports Logic Hooks.
    Only commercial flavors (PRO and ENT) supports Work Flows.
    There are some requirements easier to implement by Work Flows, but there are some other much easier to implement by Logic Hooks.
    In short words, there are requirements you can implement by either Logic Hooks or Work Flows.

    I hope I answered your question.
    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.

  3. #3
    planetcaravan is offline Sugar Community Member
    Join Date
    May 2011
    Posts
    32

    Default Re: Logic Hooks and Worflows

    Hi and thanks for the answer!

    So what's the real difference betweeen the two objects?
    Can I create worflows with Logic Hooks?

  4. #4
    blak3r's Avatar
    blak3r is offline Sugar Community Member
    Join Date
    Sep 2010
    Location
    Maryland
    Posts
    346

    Default Re: Logic Hooks and Worflows

    A workflow is created using the GUI provided to you by SugarCRM. Logic Hooks are implemented in code.

    A workflow is actually a logic hook that has been autogenerated for you.

    So, a logic hook can do everything a workflow rule could (since workflow rules generate a logic hook).

    What I do is try to implement everything I can in a workflow rule... If i can't because of some limitation, such as no way to do OR conditions on criteria or run into other various limitations... can't think of them off hand... I then custom code a logic hook.
    Sugar 6.5 Pro, On-Site (Apache 2.2, MySQL 5.5, PHP 5.3.6)

    My Sugar Addons:
    Callinize - (formerly known as yaai) Full Featured Asterisk Integration + Mobile App(fork it here) - June 2012 POTM
    Website Visitor Tracker - powered by Google Analytics provides personalized dashlet of relevant accounts/leads/keywords for each user.
    Email To Sugar - Archive emails in any mail client by adding a BCC line.
    Task Dashlets Plus- Adds custom dashlets for: tasks assigned to me by others, delegated tasks, overdue tasks, and open tasks past start date
    Full Text Search Indexer for Sugar v6.5- OSS Solution to make your KB articles searchable today!

    www.blakerobertson.com

  5. #5
    ramifriedman is offline Junior Member
    Join Date
    May 2011
    Location
    New Jersey
    Posts
    7

    Smile Re: Logic Hooks and Worflows

    Would either a workflow or a logic hook allow me to trigger an action to occur based upon a date field in a contact record.

    Two specific examples:

    1. 10 days prior to customer's birthday, automatically send an email to vendor that will instruct vendor to send a birthday gift to the client

    2. for a doctor's office, send the patient an automated phone call one day prior to date of next exam (custom field in contact table)

    None of the documentation I've read so far indicates a logic hook can be triggered by dates in the contact record.

    Am I missing something? Is there some sort of plug-in that would provide this type of functionality?

    THANKS IN ADVANCE!!!

  6. #6
    ashdwi1's Avatar
    ashdwi1 is offline Sugar Community Member
    Join Date
    May 2008
    Location
    Noida
    Posts
    427

    Default Re: Logic Hooks and Worflows

    Hello,
    What I think for logic hooks and workflows

    1. logic hook are event functions which are triggered by Sugar .
    some of events are
    before save , after save , before delete , after delete etc
    you can see a full list of such events at include/utils/LogiHook.php

    2. Workflows are set of modules in which business process are combined with tasks( emails , meetings , calls, notes , tasks etc)..
    workflows uses hooks to triggers actions after completion of any business stages ( process->process stages-> stage tasks).

    that's all
    Hope it will help

  7. #7
    blak3r's Avatar
    blak3r is offline Sugar Community Member
    Join Date
    Sep 2010
    Location
    Maryland
    Posts
    346

    Default Re: Logic Hooks and Worflows

    The two specific examples you mentioned aren't really handled by logic hooks or workflow.

    For the most part, Logic Hooks can be though of as code that occurs when a record is saved or loaded.

    In order to accomplish what you want to do you'd need to write a PHP file which:
    a) Finds the appropriate records to call (doing a sql query).
    b) Then performs that action.

    You'd then run that php file from the scheduler to run daily or hourly depending on the frequency you choose.

    There are probably sugar extensions which perform what you want. Take a look on www.sugarforge.org.
    Sugar 6.5 Pro, On-Site (Apache 2.2, MySQL 5.5, PHP 5.3.6)

    My Sugar Addons:
    Callinize - (formerly known as yaai) Full Featured Asterisk Integration + Mobile App(fork it here) - June 2012 POTM
    Website Visitor Tracker - powered by Google Analytics provides personalized dashlet of relevant accounts/leads/keywords for each user.
    Email To Sugar - Archive emails in any mail client by adding a BCC line.
    Task Dashlets Plus- Adds custom dashlets for: tasks assigned to me by others, delegated tasks, overdue tasks, and open tasks past start date
    Full Text Search Indexer for Sugar v6.5- OSS Solution to make your KB articles searchable today!

    www.blakerobertson.com

  8. #8
    pankajgunwant is offline Junior Member
    Join Date
    Jun 2011
    Posts
    1

    Default Re: Logic Hooks and Worflows

    I am trying to do the Using Dependencies in Logic Hooks as the code specified in sugar documentation is:
    <?php

    require_once("include/Expressions/Dependency.php");
    require_once("include/Expressions/Trigger.php");
    require_once("include/Expressions/Expression/Parser/Parser.php");
    require_once("include/Expressions/Actions/ActionFactory.php");
    class Update_Account_Hook {
    function updateAccount($bean, $event, $args) {
    $formula = translate('RATING_FORMULA', 'Accounts');
    $triggerFields = Parser::getFieldsFromExpression($formula);
    $dep = new Dependency('updateRating');
    $dep->setTrigger(new Trigger('true', $triggerFields));
    $dep->addAction(ActionFactory::getNewAction('SetValue ',
    array('target' => 'rating', 'value' => $formula)));
    $dep->fire($bean);
    }
    }

    ?>


    but on writing it gives following error:

    Fatal error: Cannot redeclare class Update_Account_Hook in /var/www/SugarPro-Full-6.1.0/custom/modules/Accounts/logic_hooks.php on line 8

    please help me !

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Logic Hooks e Worflows
    By planetcaravan in forum Italiano
    Replies: 0
    Last Post: 2011-05-30, 09:55 PM
  2. logic hooks logic for opportunity
    By shajiuddin in forum Developer Help
    Replies: 8
    Last Post: 2011-04-24, 12:51 PM
  3. Where to put logic hooks in v6.0.3
    By lobomaujp in forum Developer Help
    Replies: 2
    Last Post: 2010-11-21, 06:04 PM
  4. Logic Hooks
    By kalaisugar in forum Developer Help
    Replies: 7
    Last Post: 2009-05-08, 08:55 PM
  5. Logic Hooks
    By marketadvantage in forum Developer Help
    Replies: 3
    Last Post: 2009-01-30, 04:09 PM

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
  •