Results 1 to 4 of 4

Thread: Subpanel Opportunities_Products amount

  1. #1
    tritsma is offline Sugar Community Member
    Join Date
    Apr 2006
    Posts
    14

    Default Subpanel Opportunities_Products amount

    Type: SugarCRM OS
    OS: Win2003
    Version 4.2.0a

    I have linked Products module to opportunites and it works. There's one thing i cant seem to get to work:

    on the opportunity the products show but i have also created a field called product_amount in the opportunities_products table that links em.
    When i change the page showing the subpanel for example:

    'name' =>
    array (
    'vname' => 'LBL_LIST_SUBJECT',
    'widget_class' => 'SubPanelDetailViewLink',
    'width' => '25%',
    ),

    into

    'name' =>
    array (
    'vname' => 'LBL_LIST_SUBJECT',
    'widget_class' => 'SubPanelDetailViewLink',
    'width' => '25%',
    ),SQLREADER,

    it shows me the sql query. I can see that the field i want is included in the query but it automaticly puts 'products.' in front of every field so i cant seem to pick a field from another table (in this case opportunities_products)

    Does anyone know where this SQL statement is genereated so i can work around it?

  2. #2
    tritsma is offline Sugar Community Member
    Join Date
    Apr 2006
    Posts
    14

    Default Re: Subpanel Opportunities_Products amount

    its a little like a contact role in opportunities thats where i copied most of my code from contacts subpanel.

    When i view my page i get this error:

    Fatal error: Call to a member function on a non-object in C:\sugar_crm\data\SugarBean.php on line 1805

  3. #3
    tritsma is offline Sugar Community Member
    Join Date
    Apr 2006
    Posts
    14

    Default Re: Subpanel Opportunities_Products amount

    Problem solved:

    i have changed

    sugarbean.php

    line 1776

    $ret_array['select'] .= ", $this->table_name.$field $alias";

    into

    if($field == 'product_amount'){
    $ret_array['select'] .= ", opportunities_products.$field $alias";
    }else{
    $ret_array['select'] .= ", $this->table_name.$field $alias";
    }

  4. #4
    juanwang is offline Sugar Community Member
    Join Date
    Jun 2006
    Posts
    20

    Default Re: Subpanel Opportunities_Products amount

    Hi Tritsma,

    I am looking to do the same. Can you send me detail information on how you set this up? Are you able to select multiple products for an opportunity as well?

    Regards,

    Juan

Thread Information

Users Browsing this Thread

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

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
  •