Results 1 to 5 of 5

Thread: link=true help

  1. #1
    chris.marsden is offline Sugar Community Member
    Join Date
    Sep 2011
    Posts
    57

    Default link=true help

    Ok im a little stuck and was wondering if anyone had any ideas

    I have 2 modules, one called Electricity and one called accounts. if i go in to the accounts module i have a subpanel for electricity and have managed to use the below code to make a custom field linkable but get the following error with it:

    \custom\modules\elecy_Electricity\metadata\subpane ls\Account_subpanel_accountselecy_electricity.php

    Error retrieving record. This record may be deleted or you may not be authorized to view it.

    Code:
    <?php
    // created: 2011-12-21 11:38:45
    $subpanel_layout['list_fields'] = array (
      'mpan_core_c' => 
      array (
        'type' => 'varchar',
        'default' => true,
        'vname' => 'LBL_MPAN_CORE',
    	    'link' => 'MPAN_CORE_LINK',
    		    'link' => true,
    	    'widget_class' => 'SubPanelDetailViewLink',
        'target_module' => 'elecy_Electricity',
        'target_record_key' => 'MPAN_CORE_C',
        'width' => '20%',
    
      ),
    I have exactly the same code in the electricity module and it works and takes me to the correct record.

    custom\modules\elecy_Electricity\metadata\listview defs.php

    Code:
    <?php
    $module_name = 'elecy_Electricity';
    $listViewDefs [$module_name] = 
    'MPAN_CORE_C' => 
      array (
        'type' => 'varchar',
        'default' => true,
    	    'link' => true,
    			    'widget_class' => 'SubPanelDetailViewLink',
        'target_module' => 'elecy_Electricity',
        'target_record_key' => 'mpan_core_c',
        'label' => 'LBL_MPAN_CORE',
        'width' => '15%',
      ),

    thanks

  2. #2
    chris.marsden is offline Sugar Community Member
    Join Date
    Sep 2011
    Posts
    57

    Default Re: link=true help

    PS,

    any one know the code to show the View widget button

  3. #3
    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: link=true help

    All code to render subpanel fields are in /include/generic/SugarWidgets.
    Then I see two options:
    - create a new widhet class to render your field and make it works.
    - Just try to use a 'CustomCode' and render a link to desired module based in related id field.
    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

  4. #4
    chris.marsden is offline Sugar Community Member
    Join Date
    Sep 2011
    Posts
    57

    Default Re: link=true help

    is it upgrade safe to play around with code in there?

    also any ideas on the custom code anyone as not sure where to start with that.

  5. #5
    chris.marsden is offline Sugar Community Member
    Join Date
    Sep 2011
    Posts
    57

    Default Re: link=true help

    fixed with this:

    'mpr_c' =>
    array (
    'type' => 'varchar',
    'default' => true,
    'vname' => 'LBL_MPR',
    'link' => 'MPR_LINK',
    'link' => true,
    'customCode' => '<a href="index.php?module=GAS01_Gas&return_module=GAS 01_Gas&action=DetailView&record={$MPR_C.id.value}" > {$MPR_C.name.value}</a>',
    'widget_class' => 'SubPanelDetailViewLink',
    'width' => '20%',

    ),

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. 'true', or true,
    By Ramblin in forum Developer Help
    Replies: 1
    Last Post: 2011-12-31, 11:24 AM
  2. Set defaultfield audit = true
    By jpee in forum Developer Help
    Replies: 2
    Last Post: 2011-01-27, 08:43 AM
  3. Agregar Propiiedad 'link' => true en Subpanel
    By vegaai in forum Español
    Replies: 2
    Last Post: 2010-05-13, 10:38 PM
  4. SugarCRM only supports up to 20 users..Is it True?
    By sugarcare in forum General Discussion
    Replies: 2
    Last Post: 2006-08-23, 01:18 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
  •