Results 1 to 4 of 4

Thread: logic hook hangs module

  1. #1
    kdaniel is offline Junior Member
    Join Date
    Sep 2010
    Posts
    2

    Unhappy logic hook hangs module

    Hello all.

    I'm new to sugercrm development and php.

    I'm following the developers guide to creating custom hooks and want to add this function to calculate the total value over the next 5 years.
    class kld_pipeline extends kld_pipeline_sugar {

    function save($check_notify = FALSE){
    $this->totalsummitcontract = $this->fy1 + $this->fy2 + $this->fy3 + $this->fy4 + $this->fy5;
    $this->summitcut = $this->totalsummitcontract / $this->totalcontract;
    $this->totalsummitrisk = $this->totalsummitcontract * $this->probwin / 100;
    parent::save($check_notify);
    }

    function kld_pipeline(){
    parent::kld_pipeline_sugar();
    }


    Ever time I save/deploy the module, the page is now blank and I have no errors on the screen. Is there an error log file I can look at for more information on why this hangs/dies/crashes?

    Kdaniel

  2. #2
    eitrix's Avatar
    eitrix is offline Sugar Community Member
    Join Date
    Aug 2010
    Location
    Serbia
    Posts
    396

    Default Re: logic hook hangs module

    logic hooks as i do it:

    http://www.eontek.rs/?p=184
    CRM Software Engineer
    Eontek - www.eontek.rs

  3. #3
    kdaniel is offline Junior Member
    Join Date
    Sep 2010
    Posts
    2

    Unhappy Re: logic hook hangs module

    Thanks for the quick reply.

    Yes, the documentation also says this is a better way.
    Custom Bean files
    Another method is to add code directly to the custom bean. This is the somewhat more complicated approach as it requires understanding the SugarBean class, but is a far more flexible and powerful approach.
    First you must “build” your module. This can be done by either deploying your module or pressing the Publish button. Module Builder will then generate a folder for your package in “custom/modulebuilder/builds/”. Inside that folder is where Module Builder will have placed the bean files for your new module(s). In this case we want
    “custom/modulebuilder/builds/MediaTracking/SugarModules/modules/jsche_mediarequest”
    Inside you will find two files of interest. The first one is {module_name}sugar.php. This file is generated by Module Builder and may be erased by further changes in module builder or upgrades to the Sugar application. You should not make any changes to this file. The second is {module_name}.php. This is the file where you should make any changes you would like to the logic of your module. To add our timestamp, we would add the following code to jsche_mediarequest.php

    So, why doesn't it work? I would rather code directly into the bean, than create generic hooks.

    Kdaniel

  4. #4
    eitrix's Avatar
    eitrix is offline Sugar Community Member
    Join Date
    Aug 2010
    Location
    Serbia
    Posts
    396

    Default Re: logic hook hangs module

    generic or not, better then bean coding directly with no assurance for upgrade safe ways.

    As for your case, place the echo's all around and see why are u having problems and where.
    CRM Software Engineer
    Eontek - www.eontek.rs

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Logic Hook on Custom Module
    By sugarcrm_user_ in forum Developer Help
    Replies: 6
    Last Post: 2010-09-01, 01:54 PM
  2. using logic hook on emails module
    By Aisha16 in forum Developer Help
    Replies: 1
    Last Post: 2010-07-22, 09:52 AM
  3. Replies: 3
    Last Post: 2009-08-15, 03:00 AM
  4. Logic hook for a new module
    By AditiRao in forum Developer Help
    Replies: 2
    Last Post: 2009-04-14, 06:31 AM
  5. logic hook for a new module?????
    By amrutha in forum Developer Help
    Replies: 3
    Last Post: 2009-04-13, 06:39 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
  •