Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: total amount on subpanel

  1. #1
    anjireddy987 is offline Senior Member
    Join Date
    Jan 2010
    Location
    hyderabad,india
    Posts
    91

    Default total amount on subpanel

    hi,
    i have a module opportunities,and this is related to accounts.
    when new account is assigned for a particular opportunities module,it's should be displayed on subpanel
    on top menu of the sub panel i have to display the total amount related to particular accounts.
    here i am attaching the screen shot regarding this,
    any one help me regarding this how to proceed to solve this problem

    Thanks&Regards
    Anji(gramanjul@gmail.com)
    Attached Images Attached Images  

  2. #2
    kuske's Avatar
    kuske is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Germany
    Posts
    2,597

    Default Re: total amount on subpanel

    The very simpliest way would be to define a custom field in accounts and calculate this field in a logic hook after retreive of the account data.
    Harald Kuske
    Pre-Sales Engineer Central Europe

    SUGARCRM Deutschland GmbH
    Erika-Mann-Str. 53, 80636 Munich, Germany
    Email: hkuske@sugarcrm.com
    Home: http://www.sugarcrm.com


  3. #3
    anjireddy987 is offline Senior Member
    Join Date
    Jan 2010
    Location
    hyderabad,india
    Posts
    91

    Default Re: total amount on subpanel

    Thank u kuske,

    can u explain the way how can we achieve this

  4. #4
    AlexAv's Avatar
    AlexAv is offline Sugar Community Member
    Join Date
    Oct 2009
    Location
    Ukraine
    Posts
    922

    Default Re: total amount on subpanel

    Quote Originally Posted by anjireddy987 View Post
    Thank u kuske,

    can u explain the way how can we achieve this

    What do you want to know about the logic hooks?
    Last edited by AlexAv; 2010-03-02 at 06:14 AM.
    Letrium ltd. - Only high quality service
    http://letrium.com

  5. #5
    AlexAv's Avatar
    AlexAv is offline Sugar Community Member
    Join Date
    Oct 2009
    Location
    Ukraine
    Posts
    922

    Default Re: total amount on subpanel

    Quote Originally Posted by kuske View Post
    The very simpliest way would be to define a custom field in accounts and calculate this field in a logic hook after retreive of the account data.
    Can I create Logic Hooks for a Subpanel?
    Letrium ltd. - Only high quality service
    http://letrium.com

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

    Default Re: total amount on subpanel

    Yes, the logic_hook process_record is triggered by either ListView and Subpanel.

    Cheers
    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.

  7. #7
    christianknoll's Avatar
    christianknoll is offline Sugar Community Member
    Join Date
    Nov 2008
    Location
    Vienna
    Posts
    939

    Default Re: total amount on subpanel

    What you want to do requires some deep level modification int the Subpanel (resp. the ListView). We did similar things for a customer with a Filter function for the Subpanel to find records (see image attached).

    Yet I recommend you only do it if you know your way around in Sugar and are well versed in PHP. If it is important and you are not that fit get some help and somebody to do it. If required we are happy to help.


    christian.


    Quote Originally Posted by anjireddy987 View Post
    hi,
    i have a module opportunities,and this is related to accounts.
    when new account is assigned for a particular opportunities module,it's should be displayed on subpanel
    on top menu of the sub panel i have to display the total amount related to particular accounts.
    here i am attaching the screen shot regarding this,
    any one help me regarding this how to proceed to solve this problem

    Thanks&Regards
    Anji(gramanjul@gmail.com)
    Attached Images Attached Images  

  8. #8
    AlexAv's Avatar
    AlexAv is offline Sugar Community Member
    Join Date
    Oct 2009
    Location
    Ukraine
    Posts
    922

    Default Re: total amount on subpanel

    Quote Originally Posted by andopes View Post
    Yes, the logic_hook process_record is triggered by either ListView and Subpanel.

    Cheers

    Thanks for reply,
    I have solved my problem with SugarCRM widgets.
    Letrium ltd. - Only high quality service
    http://letrium.com

  9. #9
    hoangbao is offline Sugar Community Member
    Join Date
    Aug 2007
    Location
    Saigon - Vietnam
    Posts
    76

    Default Re: total amount on subpanel

    hi christian,

    please help me the logic hook to update total field in detail view when a record create in the Subpanel

    my code
    PHP Code:
    <?php
    $hook_version 
    1;
    $hook_array = Array();
    $hook_array['process_record'] = Array();
    $hook_array['process_record'][] = Array(1'process_record''custom/modules/oms_Contracts/contract_value.php','contract_value''add_contract_value');
    ?>
    PHP Code:
    <?php
    if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');

    require_once(
    'data/SugarBean.php');
    require_once(
    'include/utils.php');
    require_once(
    'modules/oms_Contracts/oms_Contracts.php');

    class 
    contract_value {

    function 
    add_contract_value(&$focus,$event,$arguments){

            require_once(
    'modules/oms_Products/oms_Products_sugar.php');
            
    $product = new oms_Products();
            
    $contract_value $focus->contract_value $product->list_price;
            
    $focus->contract_value $contract_value;
    }
    }
    ?>
    but nothing to do.

    thanks,
    hoangbao

    Quote Originally Posted by christianknoll View Post
    What you want to do requires some deep level modification int the Subpanel (resp. the ListView). We did similar things for a customer with a Filter function for the Subpanel to find records (see image attached).

    Yet I recommend you only do it if you know your way around in Sugar and are well versed in PHP. If it is important and you are not that fit get some help and somebody to do it. If required we are happy to help.


    christian.

  10. #10
    erop is offline Sugar Community Member
    Join Date
    Jan 2005
    Location
    Moscow, Russia
    Posts
    107

    Default Re: total amount on subpanel

    Quote Originally Posted by andopes View Post
    Yes, the logic_hook process_record is triggered by either ListView and Subpanel.
    Indeed this should work as written in DevGuide, etc. But I couldn't manage to fire process_record hook. In my case I need to display releted module field value in ListView mainly and DetailView. I added custom varchar field to Contacts module named 'speciality_c'. In my scenario if Meeting is related to Contact through existing Flex Relate field that I want to display that 'speciality_c' value in Meetings ListView and DetailView.

    So, I created custom/Extension/modules/Meetings/Ext/Vardefs/contact_speciality.php to add 'non-db' field:

    PHP Code:
    <?php

    $dictionary
    ['Meeting']['fields'][] = 'contact_speciality';
    $dictionary['Meeting']['fields']['contact_speciality'] = array(
        
    'name' => 'contact_speciality',
        
    'source' => 'non-db',
        
    'type' => 'varchar',
        
    'len' => 255,
        
    'vname' => 'LBL_CONTACT_SPECIALITY',
    );

    ?>
    Then in custom/modules/Meetings/logic_hooks.php define the hook:

    PHP Code:
    <?php

    $hook_version 
    1;
    $hook_array['process_record'] = array();
    $hook_array['process_record'][] = array(10'Get Contact speciality''custom/modules/Meetings/logic_hooks/get_contact_speciality.php''getContactSpeciality''getContactSpeciality');
    ?>
    And at last the hook itself in custom/modules/Meetings/logic_hooks/get_contact_speciality.php :

    PHP Code:
    <?php
    if(!defined('sugarEntry')) define('sugarEntry'true);
    require_once 
    'modules/Contacts/Contact.php';
    class 
    getContactSpeciality {
        function 
    getContactSpeciality(&$bean$event$arguments) {
            if (
    $bean->parent_type == 'Contacts') {
                
    $contact = new Contact();
                
    $contact->retrieve($bean->parent_id);
                
    $bean->contact_speciality $contact->speciality_c;
            } else {
                return;
            }
        }
    }
    ?>
    Of course, detailviewdefs.php and listviewdefs.php were modified as well to display 'contact_speciality' value. But nothing happens to make me happy.

    I tried to debug using $GLOBALS['log']->debug() but it seems that hook doesn't fire at all. (BTW, where in code tree should I place breakpoint to debug logic hook in IDE like Eclipse or NetBeans? I set breakpoint in file above, start debug session, but it seems that Sugar bypasses breakpoint. Developer mode enabled, xdebug setup properly.)

    Are there any obvious mistakes in my code that don't let process_record fires? My before_save hooks works exactly as needed.

    P.S. I'm on SugarCE 6.0.0
    Last edited by erop; 2010-10-11 at 12:00 AM. Reason: Found a typo

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Total amount on Opportunity list view
    By kinshibuya in forum Help
    Replies: 17
    Last Post: 2011-01-19, 06:39 PM
  2. Replies: 1
    Last Post: 2010-02-24, 04:23 AM
  3. total amount on opportunities subpanel
    By anjireddy987 in forum Developer Help
    Replies: 4
    Last Post: 2010-02-23, 11:22 AM
  4. calculate total amount in invoice module
    By aradhpandey in forum Developer Help
    Replies: 1
    Last Post: 2009-04-30, 11:59 AM
  5. Total amount for Opportunities
    By devknob in forum Help
    Replies: 1
    Last Post: 2007-04-24, 12:42 AM

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
  •