Results 1 to 5 of 5

Thread: default value ???

  1. #1
    tamhd_vn88 is offline Member
    Join Date
    Jun 2010
    Posts
    18

    Default default value ???

    i created module "đăng ký khách hàng". I have a field "nơi đăng ký" . I want when i click "create đăng ký khách hàng", field "nơi đăng ký" will display department of account login ( $current_user->deparment).

    Please help me in sloving this problem
    thanks & Regards



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

    Default Re: default value ???

    Hi,

    If I've understood your query well, the code written below should work

    Write in custom/YOURMODULE/views/view.edit.php

    PHP Code:
    require_once('include/MVC/View/views/view.edit.php');

    class 
    YOURMODULEViewEdit extends ViewEdit {
    function 
    display()
    {
         global 
    $current_user;
         
    $this->bean->YOUR_FIELD_NAME $current_user->department;
         
    parent::display();
    }

    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
    tamhd_vn88 is offline Member
    Join Date
    Jun 2010
    Posts
    18

    Default Re: default value ???

    Hi davidboris
    i cant find views.edit.php.
    when i go C:\Program Files\sugarcrm-5.2.0k\htdocs\sugarcrm\custom\modules\M10_Khachhan g, i only see folder "Ext" and "metadata"
    in "metadata" and "Ext", i only see files listviewdefs.php,layoutdefs.ext.php and vardefs.ext.php
    i use SugarCRM 5.2

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

    Default Re: default value ???

    Hi,

    Create that file and write the code.
    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
    tamhd_vn88 is offline Member
    Join Date
    Jun 2010
    Posts
    18

    Default Re: default value ???

    thank davidboris!!
    i add forder views, create file view.edit.php, add your code, and my module work fine. Thank you so much

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 2009-07-13, 08:16 AM
  2. Replies: 1
    Last Post: 2008-10-09, 01:20 PM
  3. Replies: 5
    Last Post: 2008-09-22, 12:11 PM
  4. help default value
    By Meyer in forum Help
    Replies: 2
    Last Post: 2007-11-15, 05:13 AM
  5. Default Value
    By sanocli in forum Help
    Replies: 2
    Last Post: 2007-08-02, 09:59 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
  •