Results 1 to 2 of 2

Thread: I create my custom module but the data from database cannot show

  1. #1
    nongball is offline Sugar Community Member
    Join Date
    Jul 2007
    Posts
    20

    Default I create my custom module but the data from database cannot show

    I create my custom module but the data from database cannot show.

    The module's name is mod_ballreport
    The table 's name in database is mod_ballreport

    The source code of the mod_ballreport.php is

    <?php
    if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
    require_once('data/SugarBean.php');
    require_once('include/utils.php');

    class mod_ballreport extends SugarBean {
    var $id;
    var $description;
    var $report_sql;
    var $name;
    var $assigned_user_id;
    var $date_modified;
    var $deleted;

    var $table_name = "mod_ballreport";
    var $module_dir = "mod_ballreport";

    var $track_on_save=true;
    var $object_name = "mod_ballreport";

    function mod_ballreport()
    {
    parent::SugarBean();
    }
    }
    ?>

    The code of vardefs.php is
    <?php
    #Ensure that the file can only be accessed via SugarCRM
    if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');

    #Define the dictionary
    $dictionary['mod_ballreport'] = array(
    #Define the table to be used, their data types, labels, etc
    'table' => 'ppi_reports',
    'unified_search' => true,
    'comment' => 'Reports',
    #Define the fields to be used
    'fields' => array(
    'id' => array(
    'name' => 'id',
    'vname' => 'LBL_ID',
    'required' => true,
    'type' => 'id',
    'reportable'=>false,
    'comment' => 'Unique identifier'
    ),
    'description' => array(
    'name' => 'description',
    'vname' => 'LBL_DESCRIPTION',
    'required' => false,
    'type' => 'text',
    'comment' => 'Report description'
    ),
    'report_sql' => array(
    'name' => 'report_sql',
    'vname' => 'LBL_REPORT_SQL',
    'required' => false,
    'type' => 'text',
    'comment' => 'Report SQL'
    ),
    'name' => array(
    'name' => 'name',
    'vname' => 'LBL_NAME',
    'required' => true,
    'dbType' => 'varchar',
    'type' => 'name',
    'len' => 50,
    'unified_search' => true,
    'comment' => 'Report name'
    ),
    'assigned_user_id' => array(
    'name' => 'assigned_user_id',
    'rname' => 'user_name',
    'id_name' => 'assigned_user_id',
    'type' => 'assigned_user_name',
    'vname' => 'LBL_ASSIGNED_USER_ID',
    'required' => false,
    'len' => 36,
    'dbType' => 'id',
    'table' => 'users',
    'isnull' => false,
    'reportable'=>true,
    'comment' => 'User assigned to this report'
    ),
    'date_modified' => array (
    'name' => 'date_modified',
    'vname' => 'LBL_DATE_MODIFIED',
    'type' => 'datetime',
    'required' => false,
    'comment' => 'Date record last modified'
    ),
    'deleted' => array (
    'name' => 'deleted',
    'vname' => 'LBL_DELETED',
    'type' => 'bool',
    'required' => true,
    'reportable'=>false,
    'comment' => 'Record deletion indicator',
    ),
    ),
    );
    ?>


    The code of listviewdef.php is
    <?php
    if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');

    $listViewDefs['mod_ballreport'] = array(
    'NAME' => array(
    'width' => '50',
    'label' => 'LBL_NAME',
    'default' => true
    ),
    'DESCRIPTION' => array(
    'width' => '50',
    'label' => 'LBL_DESCRIPTION',
    'default' => true
    ),
    'REPORT_SQL' => array(
    'width' => '50',
    'label' => 'LBL_REPORT_SQL',
    'default' => true),
    );
    ?>

    The code of listview.php is
    <?php
    if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');


    require_once ('modules/mod_ballreport/mod_ballreport.php');
    require_once('include/ListView/ListViewSmarty.php');
    require_once('modules/mod_ballreport/metadata/listviewdefs.php');


    $seedmod_ballreport = new mod_ballreport();
    $lv = new ListViewSmarty();
    $lv->displayColumns = $listViewDefs['mod_ballreport'];
    $lv->setup($seedmod_ballreport,'include/ListView/ListViewGeneric.tpl', $where,$listViewDefs['mod_ballreport']);
    echo $lv->display();



    ?>

    The output is


  2. #2
    jli
    jli is offline Junior Member
    Join Date
    May 2005
    Posts
    109

    Default Re: I create my custom module but the data from database cannot show

    have you defined your fields in your custom module's field_array.php file?

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. HELP - Act import (field mapping)
    By smelamed in forum Help
    Replies: 33
    Last Post: 2013-04-01, 09:26 PM
  2. Replies: 7
    Last Post: 2006-06-06, 08:56 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
  •