Results 1 to 5 of 5

Thread: Showing Value from database

  1. #1
    atin is offline Sugar Community Member
    Join Date
    Mar 2008
    Location
    India
    Posts
    46

    Default Showing Value from database

    Hii
    I am new in sugarcrm
    I have copied user module and make it as my one module. Now I want to show the value in the list view section fetch from my created table in database. My module name is EventProcess and I add this module in admin section. Where I have to write down the code or change the code.

    Plz plz plz help me.
    Sugar version is 4.5
    With thanks
    Atin

  2. #2
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Showing Value from database

    Hi, atin.

    Take a look at the functions get_list_view_array and fill_in_additional_list_fields, both inside Users/Your Users module copy.
    If they are not inside Users, then you need to override them from data/SugarBean.php

    Cheers

    --
    André Lopes
    Lâmpada Global Services
    Rua Bela Cintra, 299 conjunto. 51
    São Paulo, SP 01415-000
    tel1. 55 11 3237-3110
    cel. 55 11 7636-5859
    e-mail: info@lampadacrm.com.br

  3. #3
    atin is offline Sugar Community Member
    Join Date
    Mar 2008
    Location
    India
    Posts
    46

    Default Re: Showing Value from database

    Hii
    andopes
    I find both the function in my module.The function look like.
    function get_list_view_data() {
    global $image_path;
    $this->_create_proper_name_field();
    $user_fields = $this->get_list_view_array();
    if ($this->is_admin)
    $user_fields['IS_ADMIN_IMAGE'] = get_image($image_path.'check_inline', '');
    elseif (!$this->is_admin) $user_fields['IS_ADMIN'] = '';
    if ($this->is_group)
    $user_fields['IS_GROUP_IMAGE'] = get_image($image_path.'check_inline', '');
    else
    $user_fields['IS_GROUP_IMAGE'] = '';
    $user_fields['NAME'] = empty ($this->name) ? '' : $this->name;

    $user_fields['REPORTS_TO_NAME'] = $this->reports_to_name;

    return $user_fields;
    }
    And another function
    function fill_in_additional_list_fields() {
    $this->fill_in_additional_detail_fields();
    }

    /function fill_in_additional_detail_fields() {
    global $locale;

    // $this->full_name = $locale->getLocaleFormattedName($this->first_name, $this->last_name);

    $query = "SELECT u1.first_name, u1.last_name from users u1, users u2 where u1.id = u2.reports_to_id AND u2.id = '$this->id' and u1.deleted=0";
    $result = $this->db->query($query, true, "Error filling in additional detail fields");

    $row = $this->db->fetchByAssoc($result);
    $GLOBALS['log']->debug("additional detail query results: $row");

    if ($row != null) {
    $this->reports_to_name = stripslashes($row['first_name'].' '.$row['last_name']);
    } else {
    $this->reports_to_name = '';
    }

    $this->_create_proper_name_field();
    }
    what i should change???
    with thanks
    Atin

  4. #4
    atin is offline Sugar Community Member
    Join Date
    Mar 2008
    Location
    India
    Posts
    46

    Default Re: Showing Value from database

    Hii
    andopes,
    My tabe in database is :
    --
    -- Table structure for table `pg_processflow`
    --

    CREATE TABLE `pg_processflow` (
    `processid` int(11) NOT NULL auto_increment,
    `Source` varchar(20) NOT NULL,
    `Event` varchar(20) NOT NULL,
    `value` varchar(20) NOT NULL,
    `add_value` varchar(225) NOT NULL,
    `order` varchar(5) NOT NULL,
    `Status` varchar(10) NOT NULL,
    `Startdate` varchar(20) NOT NULL,
    `Enddate` varchar(20) NOT NULL,
    `parent_processid` int(11) NOT NULL,
    `CreationDate` varchar(20) NOT NULL,
    PRIMARY KEY (`processid`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;

    --
    -- Dumping data for table `pg_processflow`
    --

    INSERT INTO `pg_processflow` VALUES (1, 'lead', 'email', 'leademail', 'testmail', '1', 'Active', '2-04-2008', '', 0, '31-03-2008');
    INSERT INTO `pg_processflow` VALUES (2, 'lead', 'Task', 'Computer', '2', '1', 'Active', '4-01-2008', '4-03-2008', 0, '4-01-2008');
    I want to populate the listview as like:
    Source|Value|Event|Status
    Plz help me........
    Thanks in advance
    Atin

  5. #5
    clint's Avatar
    clint is offline Sugar Team Member | Forums Lead Moderator
    Join Date
    Aug 2004
    Location
    Silicon Valley
    Posts
    2,120

    Default Re: Showing Value from database

    I would suggest using the Module Builder to build this new module rather than copying the code directly. It will be much, much quicker and less error prone.
    Sugar Developer Zone - developer resources | Sugar University - user and admin training
    Sugar Docs - user and admin documentation |
    Sugar Bug Tracker - Enter or view bugs
    SugarForge- open source modules, themes, lang packs | SugarExchange - commercial extensions

    Clint Oram
    Chief Technology Officer and Co-founder
    SugarCRM

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Data is in Database but not showing in Listview
    By VeonConsulting in forum Developer Help
    Replies: 1
    Last Post: 2008-02-26, 06:54 AM
  2. step 3 installation problem
    By voitek in forum Installation and Upgrade Help
    Replies: 10
    Last Post: 2007-02-14, 04:35 PM
  3. Repair Database does not
    By mmakowski in forum Help
    Replies: 1
    Last Post: 2007-01-03, 04:58 AM
  4. Replies: 2
    Last Post: 2006-10-24, 05:48 PM
  5. Replies: 0
    Last Post: 2006-07-17, 04:11 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
  •