Results 1 to 3 of 3

Thread: where exactly i can use logic hook?

  1. #1
    shrisamsalunke is offline Sugar Community Member
    Join Date
    Dec 2011
    Posts
    46

    Default where exactly i can use logic hook?

    hello everyone,
    i study about logic hook but i implement after_save and before_save but i can't understand exactly what use of logic hook................and if you know brief of logic hook pls guide me............

  2. #2
    heta's Avatar
    heta is offline Sugar Community Member
    Join Date
    Nov 2007
    Location
    Ahmedabad,India
    Posts
    214

    Default Re: where exactly i can use logic hook?

    if you need to change value of some field, something like calculated field, e.g., rate per day(10) * number of days(10) = cost (100), the basic example, you can achieve this by logic hook(apart from javascript).

    in this case you will use, before save, because after the calculation you need to save the value into database.

    for after save, example would be, you want to send a notification to some user..

    the sugarcrm developer guide says

    Custom Logic (or "Business Logic Hooks") allows you to add functionality to certain actions, such as before saving a bean, in an upgrade-safe manner. This is accomplished by defining hooks, which are placed in the custom/ directory, which will be called in the SugarBean in response to events at runtime.

    Because the code is located separate from the core SugarCRM code, it is upgrade-safe.
    hope this helps.
    Best Regards
    ---------------------------------------
    Heta Shah - iNET PROCESS
    heta.shah@inetprocess.com
    http://www.inetprocess.co.in
    Projects :
    iNETDocs -Project of the month(Dec-2008)
    iNETGoogleMap

  3. #3
    shrisamsalunke is offline Sugar Community Member
    Join Date
    Dec 2011
    Posts
    46

    Default Re: where exactly i can use logic hook?

    hi heta,
    thanks for guiding me..................i hope this will help me in future

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. Logic Hook Help
    By hazyumps in forum Developer Help
    Replies: 1
    Last Post: 2011-01-25, 01:44 AM
  3. Replies: 10
    Last Post: 2010-11-16, 02:41 AM
  4. Replies: 3
    Last Post: 2009-08-15, 03:00 AM
  5. Help with a Logic Hook
    By Iggby in forum Developer Help
    Replies: 6
    Last Post: 2009-01-29, 12:01 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
  •