Results 1 to 2 of 2

Thread: Clicking on Foriegn Key hyperlink Field in listing view gives error ??

  1. #1
    gverma is offline Member
    Join Date
    Jul 2008
    Posts
    18

    Question Clicking on Foriegn Key hyperlink Field in listing view gives error ??

    Dear All,

    I created a new module called cuspk_grants such that it would have a many to one relationship with projects. -- One project could have many grants.

    I've managed to get the corresponding project name in the listing of the grant module's records. Now, the listing of the grants records look like this: http://www.sugarcrm.com/forums/attac...tid=3523&stc=1

    When I click on the "project name" hyperlink, I expect to be taken to the details of the corresponding project, but instead, I get this error:

    Error: File [modules/Home/metadata/detailviewdefs.php] is missing. Unable to create because no corresponding HTML file was found.

    Any ideas would be appreciated. Right now, There is a file called $SUGAR_HOME/modules/cuspk_Grants/metadata/detailviewdefs.php which goes like this:

    PHP Code:
    <?php
    $module_name 
    'cuspk_Grants';
    $viewdefs = array (
    $module_name =>
    array (
      
    'DetailView' =>
      array (
        
    'templateMeta' =>
        array (
          
    'form' =>
          array (
            
    'buttons' =>
            array (
              
    => 'EDIT',
              
    => 'DUPLICATE',
              
    => 'DELETE',
            ),
          ),
          
    'maxColumns' => '2',
          
    'widths' =>
          array (
            
    =>
            array (
              
    'label' => '10',
              
    'field' => '30',
            ),
            
    =>
            array (
              
    'label' => '10',
              
    'field' => '30',
            ),
          ),
        ),
        
    'panels' =>
        array (
          
    '' =>
          array (
            
    =>
            array (
              
    =>
              array (
                
    'name' => 'project_name',
                
    'label' => 'LBL_PROJECT_NAME',
              ),
              
    =>
              array (
                
    'name' => 'grant_date',
                
    'label' => 'LBL_GRANT_DATE',
              ),
            ),
            
    =>
            array (
              
    =>
              array (
                
    'name' => 'grant_amount',
                
    'label' => 'LBL_GRANT_AMOUNT',
              ),
            ),
            
    =>
            array (
              
    =>
              array (
                
    'name' => 'description',
                
    'label' => 'LBL_DESCRIPTION',
              ),
            ),
          ),
        ),
      ),
    )
    );
    ?>
    Attached Images Attached Images  

  2. #2
    gverma is offline Member
    Join Date
    Jul 2008
    Posts
    18

    Default Re: Clicking on Foriegn Key hyperlink Field in listing view gives error ??

    Just replying to myself:

    I came over this issue by un-hyperlinking the project name (the foriegn key column) and rather linking other columns like Grant description or Grant amouunt. For this, I had to change the code like this in $SUGAR_HOME/custom/modules/cuspk_Grants/metadata/listviewdefs.php

    PHP Code:
      'PROJECT_NAME' =>
      array (
      
    'width' => '10',
      
    'label' => 'LBL_PROJECT_NAME',
      
    'dynamic_module' => 'PARENT_TYPE',
      
    'id' => 'PROJECT_ID',
      
    'default' => true,
      
    //  'link' => true,                                       // commented this to take the hyperlink out
      
    'sortable' => true,                                    
      
    'ACLTag' => 'PROJECT',                          
      
    'related_fields' => array (=> 'project_id'),  // this is really required to get the project name
      
    ),
    ..
    ..
      array (
        
    'width' => '10',
        
    'label' => 'LBL_GRANT_AMOUNT',
        
    'link' => true,                                   //added this
        
    'default' => true,
      ),
    ..
    ..
      
    'DESCRIPTION' =>
      array (
        
    'width' => '10',
        
    'label' => 'LBL_DESCRIPTION',
        
    'sortable' => false,
        
    'link' => true,                                   //added this
        
    'default' => true,
      ), 
    Now, the listing view of Grants module looks like this:

    When I click on any of the hyperlink, I get a page like this:


    Later, when I click on the Project name hyperlink HERE, I am looking at the associated project record in the projects module. Viola! This is how it looks:
    Attached Images Attached Images    

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 10
    Last Post: 2006-10-12, 08:59 AM
  2. Account Detailed View Error
    By ScottD in forum Help
    Replies: 3
    Last Post: 2005-07-29, 03:23 PM
  3. Error in Employee View
    By scoats in forum Help
    Replies: 1
    Last Post: 2005-05-26, 01:25 PM
  4. How to add an existing field to a list view in field layout?
    By Lawrence in forum General Discussion
    Replies: 1
    Last Post: 2005-04-22, 01:38 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
  •