Results 1 to 2 of 2

Thread: data display in subpanel

  1. #1
    allenl is offline Sugar Community Member
    Join Date
    Sep 2007
    Posts
    44

    Default data display in subpanel

    I created a custom module (quotation) and there was column called OpportID in table which stored the opportunityID.
    I want to display the opportunity name in subpanel but fails. I can only get the opportID. Any suggestion
    will be really appreciated.

    -------quotation/subpanels/default.php-----------
    'OpportID'=>array(
    'name' => 'OpportID',
    'vname' => 'LBL_OPPORTUNITY_ID',
    'width' => '10%',
    ),


    ---------------------vardefs.php---------------
    'OpportID'=>
    array (
    'name' => 'OpportID',
    'rname' => 'name',
    'id_name' => 'id',
    'vname' => 'LBL_OPPORTUNITY_ID',
    'type' => 'Opportunity',
    'table' => 'opportunities',
    'isnull' => 'false',
    'dbType' => 'id',
    'len' => '36',
    'reportable'=>false,
    'comment' => 'opportunity name'
    ),
    'Opportunity' =>
    array ( 'name' => 'Opportunity',
    'vname' => 'LBL_OPPORTUNITY',
    'type' => 'varchar',
    'reportable'=>false,
    'source'=>'non-db',
    ),
    -----------------------------------------------end vardefs.php-------------

  2. #2
    pikpik is offline Junior Member
    Join Date
    Oct 2007
    Posts
    4

    Default Re: data display in subpanel

    I'm really not sure, but I think you should look at the implementation of the ContactOpportunityRelationship files. You will find them in your /modules/contacts folder.

    Once you have found them, take a look at your contacts/vardefs.php file, and the in the /subpanel/ForOpportunities.php file to see how to use it.

    I have already added a field 'comment' on my ContactOpportunity relationship (I use it to propose candidates for opportunities I have with some clients. So I want to know if they were introduced, not yet introduced, refused, accepted).

    To display such a field, I found a subtable in the vardefs file of the contacts module which consists of all the field in the relationship they want to display. When this subtable is loaded, in the vardefs file again, they use the variables they just created and define them as standard variables.

    What I did first is to add my field to the table opportunities_contacts, then I loaded it in this subtable, and declare it after this subtable in the contacts module. To display it then just add the variable name in the subpanel, or anywhere else you want it to be displayed.

    Hope it will help!
    Last edited by pikpik; 2007-11-14 at 03:34 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Sql data from another database under a subpanel.
    By andresol in forum Developer Help
    Replies: 10
    Last Post: 2011-12-07, 03:58 AM
  2. Subpanel data blank rows?
    By kheald in forum Developer Help
    Replies: 1
    Last Post: 2007-09-14, 12:19 AM
  3. Sorting data within the subpanel
    By kheald in forum Developer Help
    Replies: 1
    Last Post: 2007-09-14, 12:07 AM
  4. Replies: 9
    Last Post: 2007-06-12, 07:20 PM
  5. subpanel data in the editview??
    By sugarcare in forum Developer Help
    Replies: 12
    Last Post: 2006-08-30, 09:37 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
  •