Results 1 to 9 of 9

Thread: Custom Module & Field Trouble

  1. #1
    RedPoint is offline Member
    Join Date
    Jun 2010
    Posts
    14

    Default Custom Module & Field Trouble

    I've created a custom module, and db table. Everything was working fine until I added a new custom field "ftp_name" to the database and attempted to include it in the detail and edit views.

    I added the fields to vardefs, field_arrays, and the metadata for detail and edit view, but I cannot get the field to show up. Any suggestions on how I might fix this problem?

  2. #2
    davidboris is offline Sugar Community Member
    Join Date
    May 2010
    Posts
    1,113

    Default Re: Custom Module & Field Trouble

    HI,

    What version of sugar are you using ?

    Please Attach a file vardefs.php of your custom module.
    Thumbs up.

    Skype ID - david__boris

    SugarForge Projects:

    WYSIWYG now in studio!(Version 1.1 is out now!)

    Sugar Feeds on your personalized home pages like iGoogle, My Yahoo!, etc.

    Fab Tools! > Dashlet Not Followed Opportunities for past six Months

  3. #3
    RedPoint is offline Member
    Join Date
    Jun 2010
    Posts
    14

    Default Re: Custom Module & Field Trouble

    This is the code I wrote in vardefs for the field:
    PHP Code:
      'ftp_name' =>
      array (
        
    'name' => 'ftp_name',
        
    'vname' => 'LBL_FTP_NAME',
        
    'type' => 'varchar',
        
    'len' => '255',
        
    'required' => false,
        
    'comment' => 'The FTP Username for this publication'
      
    ), 
    I have added the correct label to the language file as well. The label appears in the detail and edit view. No fields appears next to the label in edit view, and no data is displayed in detail view.

  4. #4
    davidboris is offline Sugar Community Member
    Join Date
    May 2010
    Posts
    1,113

    Default Re: Custom Module & Field Trouble

    Hi,

    Code seems good.

    Have you tried to repair rebuild ? and check whether the field is created in DB or not ?

    If possible Attach files that you have change for adding this field. Also specify which version & flavour of sugar are you using ?
    Thumbs up.

    Skype ID - david__boris

    SugarForge Projects:

    WYSIWYG now in studio!(Version 1.1 is out now!)

    Sugar Feeds on your personalized home pages like iGoogle, My Yahoo!, etc.

    Fab Tools! > Dashlet Not Followed Opportunities for past six Months

  5. #5
    RedPoint is offline Member
    Join Date
    Jun 2010
    Posts
    14

    Default Re: Custom Module & Field Trouble

    It's sugar community edition v5.5 I believe. I would attach the files, but I've modified the entire module, it's practically built from scratch. I don't think you'd care to root through the entire thing.

    The field is definitely in the database. I added it there myself. I've also included the variable in the class:

    PHP Code:
    class Publications extends SugarBean {
    ...
        var 
    $name;
        var 
    $description;
        var 
    $ftp_name;
    ... 
    And here it is being called by the editview metadata:
    PHP Code:
    'panels' =>array (
              
    'default' => array (
                        array (
                        ...
                        array (
                            array(
    'name'=>'ftp_name''label'=>'LBL_FTP_NAME''displayParams'=>array('size'=>100)),
                        ),   
                        ... 
    I don't know if this is relevant, but I've also tried adding the field to the field_arrays.php for this module:
    PHP Code:
    $fields_array['Publications'] = array ('column_fields' => Array("id"
            
    "date_entered"
            
    "date_modified"
            
    "modified_user_id"
            
    "created_by"
            
    "name"
            
    "ftp_name"
            
    "description"
            
    ),
            
    'list_fields' =>  Array('id'
                
    ,'name'
                
    ,'date_modified'
                
    ,'created_by'
        
    ),
        
    'required_fields' =>  array("name"=>1),
    ); 
    --EDIT--
    I've rebuilt the module, and roles, tons of times via the admin repair tools and this hasn't made a difference. I also have developer mode turned on so this shouldn't make a difference.

    --EDIT--
    There are no errors in the sugarcrm.log file either. So it doesn't appear to be a core file problem.
    Last edited by RedPoint; 2010-07-14 at 05:22 PM.

  6. #6
    davidboris is offline Sugar Community Member
    Join Date
    May 2010
    Posts
    1,113

    Default Re: Custom Module & Field Trouble

    hi,

    Everything seems to be ok. Need to check it properly.

    i guess more information will be needed so here is my skype id david__boris
    Thumbs up.

    Skype ID - david__boris

    SugarForge Projects:

    WYSIWYG now in studio!(Version 1.1 is out now!)

    Sugar Feeds on your personalized home pages like iGoogle, My Yahoo!, etc.

    Fab Tools! > Dashlet Not Followed Opportunities for past six Months

  7. #7
    RedPoint is offline Member
    Join Date
    Jun 2010
    Posts
    14

    Default Re: Custom Module & Field Trouble

    Well, if you need more information have at it. This is a zip file that contains the whole module (such as it is).

    The module has been added, by hand, to the /include/modules.php and it otherwise working properly. I can quick create items, and edit/delete to my hearts content. It is only these ftp fields that don't work.
    Attached Files Attached Files

  8. #8
    davidboris is offline Sugar Community Member
    Join Date
    May 2010
    Posts
    1,113

    Default Re: Custom Module & Field Trouble

    Hi,

    Try changing this

    PHP Code:
    $fields_array['Publications'to $fields_array['Publication'
    in Publications\field_arrays.php
    Thumbs up.

    Skype ID - david__boris

    SugarForge Projects:

    WYSIWYG now in studio!(Version 1.1 is out now!)

    Sugar Feeds on your personalized home pages like iGoogle, My Yahoo!, etc.

    Fab Tools! > Dashlet Not Followed Opportunities for past six Months

  9. #9
    RedPoint is offline Member
    Join Date
    Jun 2010
    Posts
    14

    Default Re: Custom Module & Field Trouble

    Well, changing that particular one didn't do the trick. However, I took it as an inspiration and replaced every instance of the singular word 'Publication' with the plural 'Publications' problem solved.

    Thank you for setting me on the right track!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Custom Module Permissions Trouble
    By RedPoint in forum Help
    Replies: 2
    Last Post: 2010-07-13, 02:54 PM
  2. Replies: 3
    Last Post: 2010-05-11, 10:30 AM
  3. Replies: 1
    Last Post: 2009-03-25, 12:26 AM
  4. custom module custom field relate type error
    By kidpollo in forum General Discussion
    Replies: 0
    Last Post: 2007-03-24, 02:14 AM
  5. Database Trouble - Custom Module
    By vidtechsteve in forum Developer Help
    Replies: 4
    Last Post: 2005-10-29, 06:54 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
  •