Results 1 to 3 of 3

Thread: How does subpanel know where to get its data?

  1. #1
    rexavh is offline Sugar Community Member
    Join Date
    Aug 2007
    Location
    Southern England
    Posts
    59

    Default How does subpanel know where to get its data?

    I have a custom package built with module builder with two related modules/tables (Kits and Components). The relationship is many-many (a Kit can have many Components and a Component can feature in many Kits). The sequence of the Components in a Kit is significant and so I have added a Component Seq No field to the join table as an attribute of the relationship. I have created a ForKits subpanel in the Components module. I want this subpanel to show the Component Seq No from the join table with descriptive information from the Component table. How can I do this?

    Using the Opportunity-Contacts relationship as a model I have managed to add a button/form to edit the Component Seq No (like the Opportunity-Role) and this seems to work apart from the fact that the Kit-ID and Component-ID are not being passed to the form to prepopulate the appropriate fields. Perhaps this will just work when the subpanel is showing the right data?

    Thanks so much for any assistance/pointers you can give me
    Alison Hedger
    avh@rexprocess.com

  2. #2
    mzigman is offline Member
    Join Date
    Dec 2008
    Posts
    7

    Default Re: How does subpanel know where to get its data?

    I am searching for a similar answer in this post:
    http://www.sugarcrm.com/forums/showt...t=relationship

    Can you share how you added the Sequence Number? Are you able to get data to populate into the relationship table?

  3. #3
    Superman's Avatar
    Superman is offline Sugar Community Member
    Join Date
    Oct 2005
    Location
    Kazakhstan
    Posts
    852

    Default Re: How does subpanel know where to get its data?

    Look data/SugarBean.php for:
    PHP Code:
    /**
         * Constructs a query to fetch data for supanels and list views
         *
         * It constructs union queries for activities subpanel.
         *
         * @param Object $parentbean constructing queries for link attributes in this bean
         * @param string $order_by Optional, order by clause
         * @param string $sort_order Optional, sort order
         * @param string $where Optional, additional where clause
         *
         * Internal Function, do not overide.
         */
        
    function get_union_related_list($parentbean$order_by ""$sort_order=''$where "",
        
    $row_offset 0$limit=-1$max=-1$show_deleted 0$subpanel_def)
        { 

    If you follow the code of this function, you may understand that you're able to set your custom queries for fetching information in subpanels!
    One more time we see how Sugar is flexible.
    Farkhad Rakhimzhanov
    E-mail: farkhad@gmail.com
    Skype: rakikama

    SuperTimesheet and Invoicing — timesheet tool with invoicing for SugarCRM.
    Book time against Cases, Project Tasks and Projects.
    Create invoice regarding booked time, print it in PDF or HTML,
    customize template as you like.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 0
    Last Post: 2008-11-19, 03:21 PM
  2. why subpanel lose data
    By arffup in forum Help
    Replies: 0
    Last Post: 2008-07-10, 10:07 PM
  3. subpanel shows all the data not the related data
    By snehalsapar in forum Developer Help
    Replies: 5
    Last Post: 2008-05-23, 08:22 PM
  4. Subpanel data blank rows?
    By kheald in forum Developer Help
    Replies: 1
    Last Post: 2007-09-14, 12:19 AM
  5. Replies: 9
    Last Post: 2007-06-12, 07:20 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
  •