How to extend bean functions in 7.2?

I'm using SugarCRM 7.2. I have written some functions directly on modules/Products/Product.php. But this is not an upgrade safe manner. So can anyone please help me on how can I move those functions to custom folder? Previously I've done it through controller.php but I'm not very much confident in Sugar 7.2 can anyone help me out please
Parents
  • what I have tried is 

    1. created productBundle.php at custom/Extension/application/Ext/Include

    2. put this code over there

    $beanList['ProductBundles']     = 'ProductBundle';
    $beanFiles['ProductBundle']     = 'custom/modules/ProductBundles/customProductBundles.php';

    3. Repair Rebuild

    in customProductBundles.php I have extended from main module like 

    include 'modules/ProductBundles/ProductBundle.php';
    class customProductBundles extends ProductBundle {
         function customProductBundle()
         {
                parent::ProductBundle();
                $this->team_id = 1;
         }
    }

    but its not calling the bean from custom ... if i echo some text its not reflecting .. but if i echo some text in modules/ProductBundles/ProductBundle.php its reflecting

    Am I missing anything or this is not a right approach?
Reply
  • what I have tried is 

    1. created productBundle.php at custom/Extension/application/Ext/Include

    2. put this code over there

    $beanList['ProductBundles']     = 'ProductBundle';
    $beanFiles['ProductBundle']     = 'custom/modules/ProductBundles/customProductBundles.php';

    3. Repair Rebuild

    in customProductBundles.php I have extended from main module like 

    include 'modules/ProductBundles/ProductBundle.php';
    class customProductBundles extends ProductBundle {
         function customProductBundle()
         {
                parent::ProductBundle();
                $this->team_id = 1;
         }
    }

    but its not calling the bean from custom ... if i echo some text its not reflecting .. but if i echo some text in modules/ProductBundles/ProductBundle.php its reflecting

    Am I missing anything or this is not a right approach?
Children
No Data