Results 1 to 3 of 3

Thread: Field missing from ListView (custom module)

  1. #1
    Sparrowhawk is offline Junior Member
    Join Date
    Jun 2009
    Posts
    3

    Default Field missing from ListView (custom module)

    Hi,

    I really need somebody's help!

    I have a custom module and have set up the fields and Layouts. All is working correctly except that I have one field that won't appear in the ListView on our Linux test box.

    Steps:
    • I created a dropdown list using the DropDown Editor. This has values such as Submitted, Approved, etc
    • I added a field, 'status' to the module's list of fields, making it of type dropdown and giving it the dropdown above as its source
    • In the Layouts editor, I added the field to all the layouts. On Detail, Edit and Search, the field appears. However, when I added it and deployed it on ListView, the field does not appear, despite appearing in the custom/modules/<my module>/metadata/listviwedefs.php file.


    Here is the code generated in custom/modules/<my module>/metadata/lisviewdefs.php, with the field in question being STATUS_C: (module name changed to <my module>)

    Code:
    <?php
    $listViewDefs ['<my module>'] = 
    array (
      'DATE_ENTERED' => 
      array (
        'width' => '10%',
        'label' => 'LBL_DATE_ENTERED',
        'default' => true,
      ),
      'FIRST_NAME_C' => 
      array (
        'width' => '10%',
        'label' => 'LBL_FIRST_NAME',
        'link' => true,
        'default' => true,
      ),
      'LAST_NAME_C' => 
      array (
        'width' => '10%',
        'label' => 'LBL_LAST_NAME',
        'link' => true,
        'default' => true,
      ),
      'EMAIL_ADDRESS_C' => 
      array (
        'width' => '10%',
        'label' => 'LBL_EMAIL_ADDRESS',
        'default' => true,
      ),
      'ADDRESS_TOWN_CITY_C' => 
      array (
        'width' => '10%',
        'label' => 'LBL_ADDRESS_TOWN_CITY',
        'default' => true,
      ),
      'POSTCODE_C' => 
      array (
        'width' => '10%',
        'label' => 'LBL_POSTCODE',
        'default' => true,
      ),
      'MOBILE_NUMBER_C' => 
      array (
        'width' => '10%',
        'label' => 'LBL_MOBILE_NUMBER',
        'default' => true,
      ),
      'LANDLINE_NUMBER_C' => 
      array (
        'width' => '10%',
        'label' => 'LBL_LANDLINE_NUMBER',
        'default' => true,
      ),
      'TRAINING_PROVIDER_C' => 
      array (
        'width' => '5%',
        'label' => 'LBL_TRAINING_PROVIDER',
        'default' => true,
      ),
      'STATUS_C' => 
      array (
        'width' => '5%',
        'label' => 'LBL_STATUS',
        'sortable' => false,
        'default' => true,
      ),
      'ADDRESS_LINE_2_C' => 
      array (
        'width' => '10%',
        'label' => 'LBL_ADDRESS_LINE_2',
        'default' => false,
      ),
      'ADDRESS_LINE_1_C' => 
      array (
        'width' => '10%',
        'label' => 'LBL_ADDRESS_LINE_1',
        'default' => false,
      ),
      'OTHER_C' => 
      array (
        'width' => '10%',
        'label' => 'LBL_OTHER',
        'default' => false,
      ),
      'QUESTION_1_C' => 
      array (
        'width' => '10%',
        'label' => 'LBL_QUESTION_1',
        'default' => false,
      ),
      'QUESTION_2_C' => 
      array (
        'width' => '10%',
        'label' => 'LBL_QUESTION_2',
        'default' => false,
      ),
      'QUESTION_5_C' => 
      array (
        'width' => '10%',
        'label' => 'LBL_QUESTION_5',
        'default' => false,
      ),
      'QUESTION_3_C' => 
      array (
        'width' => '10%',
        'label' => 'LBL_QUESTION_3',
        'default' => false,
      ),
      'QUESTION_4_C' => 
      array (
        'width' => '10%',
        'label' => 'LBL_QUESTION_4',
        'default' => false,
      ),
      'QUESTION_6_C' => 
      array (
        'width' => '10%',
        'label' => 'LBL_QUESTION_6',
        'sortable' => false,
        'default' => false,
      ),
      'ORGANISATION_C' => 
      array (
        'width' => '10%',
        'label' => 'LBL_ORGANISATION',
        'default' => false,
      ),
    );
    ?>
    Here is the cache/modules/<my module>/<my module>vardefs.php definition for the field:

    snip
    Code:
    'status_c' => 
        array (
          'required' => '1',
          'source' => 'custom_fields',
          'name' => 'status_c',
          'vname' => 'LBL_STATUS',
          'type' => 'enum',
          'massupdate' => '1',
          'default' => 'Submitted',
          'comments' => '',
          'help' => '',
          'importable' => 'true',
          'duplicate_merge' => 'disabled',
          'duplicate_merge_dom_value' => '0',
          'audited' => 1,
          'reportable' => 0,
          'len' => 100,
          'options' => 'application_status',
          'studio' => 'visible',
          'id' => '<my module>status_c',
          'custom_module' => '<my module>',
        ),
    snip

    Any ideas?

    Incidentally, when I did this on my Mac at home to test out the steps, it works, and generates the same data... I think I'm missing something really obvious but can't think what
    Last edited by Sparrowhawk; 2009-06-19 at 09:55 AM.

  2. #2
    Sparrowhawk is offline Junior Member
    Join Date
    Jun 2009
    Posts
    3

    Default Re: Field missing from ListView (custom module)

    Well, I seem to have fixed it in a very roudabout way!

    First, I changed the status value for a record and saved it.
    Next, I went to advanced search, and searched for that status. No records shown!
    So then I modified the output fields on the Advanced search page - the status was in the hidden column, so I moved it to shown.
    I searched again on the same status, and this time both the column and the record showed.
    I moved around the site a little, then came back to the module - the change appears to have stuck, even in basic search mode.

    Now, I have *no* idea as to why the steps above should help, but they have, so just in case anyone else has this issue, try the above, it may help.


    Forgot to mention in initial post: running SugarCRM 5.1 CE

  3. #3
    marklark is offline Sugar Community Member
    Join Date
    Jan 2010
    Location
    Colorado Springs, USA
    Posts
    29

    Default Re: Field missing from ListView (custom module)

    Don't ever delete this solution!

    It's a lifesaver!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Custom field in listview and subpanel
    By SanderMarechal in forum Developer Help
    Replies: 0
    Last Post: 2008-10-17, 02:03 PM
  2. Custom Module Relate Field doesn't show on ListView
    By fxbrandon in forum Developer Help
    Replies: 5
    Last Post: 2008-10-04, 10:05 AM
  3. Sort based on non-db field in Custom Module ListView
    By Tryphan in forum Developer Help
    Replies: 6
    Last Post: 2008-08-20, 12:01 PM
  4. Custom field beneath ListView
    By madmat in forum Developer Help
    Replies: 0
    Last Post: 2008-08-05, 04:10 PM
  5. Sugar 4 Custom Field , what am i missing ?
    By simon2112b in forum Help
    Replies: 2
    Last Post: 2006-02-05, 11:49 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
  •