Results 1 to 3 of 3

Thread: Related module field in Subpanel

  1. #1
    ericwindham is offline Member
    Join Date
    Aug 2008
    Posts
    10

    Question Related module field in Subpanel

    Hi all,

    I am having trouble with a client request.

    We use the 'Contacts' module as our customer module. The Contacts module has a one-to-many relationship with the 'Opportunities' module.

    Our client wants a Contacts subpanel that also has fields from the most recently created related Opportunity. So it would look something like the following:

    Code:
    Contact.Name         Contact.Email          Opportunity.some_field           Opportunity.some_other_field
    Does anyone know how to do this?

  2. #2
    rafael.q.g@hotmail.com's Avatar
    rafael.q.g@hotmail.com is offline Sugar Community Member
    Join Date
    Jun 2011
    Location
    Florianópolis - Brazil
    Posts
    782

    Default Re: Related module field in Subpanel

    On subpanel each field is rendered by a "widget".
    A possible way to do that is to create a widget for each fiield you want to have and program teh code to retrieve and write that.
    Here is where widhets are coded:
    include/generic/SugarWidgets/*.*

    You could get based in some existing one to make yours.
    Rafael Queiroz Gonçalves
    Advanced OMG UML Certified Professional
    Sun Certified Enterprise Architect for the Java Platform
    Sun Certified Programmer for the Java 2 Platform
    IBM Certified Advanced Application Developer - Lotus Notes and Domino
    IBM Certified Application Developer - IBM WebSphere Portlet Factory
    Computer Science Mastering / UFSC - PPGCC

  3. #3
    ericwindham is offline Member
    Join Date
    Aug 2008
    Posts
    10

    Default Re: Related module field in Subpanel

    Thanks for the response

    I've tried that and the following:

    Code:
    array (
        'name' => 'monthly_payment',
        'vname' => 'LBL_MONTHLY_PAYMENT',
        'type' => 'varchar',
        'function' => array('name'=>'getMonthlyPayment', 'returns'=>'html', 'include'=>'custom/modules/Contacts/ContactsOpFields.php'),
        'len' => '10',
        'source' => 'non-db',
        'studio' => 'visible',
        'comment' => 'What is this customers monthly payment, if available'
    )
    With this version, I can add the field to the Detail View, but it will not show in the subpanel. It's just an empty field in the subpanel.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Related field did not show in the subpanel.
    By kenyamash in forum Developer Help
    Replies: 0
    Last Post: 2011-11-30, 11:33 AM
  2. subpanel for related field in module
    By guest_23 in forum Developer Help
    Replies: 0
    Last Post: 2011-11-15, 07:54 AM
  3. Replies: 0
    Last Post: 2008-07-05, 05:24 PM
  4. subpanel issues for a related field
    By ptemplin7 in forum Help
    Replies: 6
    Last Post: 2008-03-25, 10:13 AM
  5. adding related field on subpanel
    By y2chuck in forum Developer Help
    Replies: 0
    Last Post: 2005-11-14, 07:22 PM

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
  •