Results 1 to 6 of 6

Thread: Creating a date_hour Field

  1. #1
    sperson is offline Member
    Join Date
    Aug 2008
    Posts
    7

    Question Creating a date_hour Field

    Hi, how can i add a date_hour field using the module builder?

    If it's nor possible can i add an hour field at least?

    Tanks.

  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: Creating a date_hour Field

    Hi sperson

    How do you want to use that field?
    You could add a dropdown field (values 0 - 23).

    Cheers
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  3. #3
    sperson is offline Member
    Join Date
    Aug 2008
    Posts
    7

    Default Re: Creating a date_hour Field

    Hi Andre, i need to create a field for schedulling a case attendance, fro example.

    The customer wants to schedulle the tecnical visit for 20/09/08 at 23:30.

    I need to create a field called "Schedulled to:" and them i just select the date and time.

    Actually i created two fields, one for the date (date field) and one for the hour (text_field with 5 caracters)

    Thanks.

  4. #4
    mikesolomon is offline Sugar Community Member
    Join Date
    Feb 2008
    Location
    UK
    Posts
    1,467

    Default Re: Creating a date_hour Field

    To create a date time field I added a date field then changed vardefs to make it a datetime field

    'date_start' =>
    array (
    'required' => false,
    'name' => 'date_start',
    'vname' => 'LBL_DATE_START',
    'type' => 'datetime',
    'massupdate' => 0,
    'comments' => '',
    'help' => '',
    'duplicate_merge' => 'disabled',
    'duplicate_merge_dom_value' => 0,
    'audited' => 0,
    'reportable' => 0,
    'len' => '25',
    ),

    Then run a repair

    I also changed editviewdefs to set the type

    array (
    'name' => 'date_start',
    'type' => 'datetimecombot',
    'label' => 'LBL_DATETIME_START',
    ),
    Mike Solomon
    Development Manager
    Ivy Ltd
    www.ivy.ltd.uk]www.ivy.ltd.uk

    php version 5.2.6
    MySql 5.1.59

  5. #5
    sperson is offline Member
    Join Date
    Aug 2008
    Posts
    7

    Default Re: Creating a date_hour Field

    Hi Mike, thanks for the reply, i just have one more question. Where is locate this vardefs file ?

    Because this is not a native field i imagine that this code is not in the /modules/Cases vardefs file.

    Where are locate the vardefs related do new fields created by the user.

    Thanks

  6. #6
    mikesolomon is offline Sugar Community Member
    Join Date
    Feb 2008
    Location
    UK
    Posts
    1,467

    Default Re: Creating a date_hour Field

    Quote Originally Posted by sperson
    Hi Mike, thanks for the reply, i just have one more question. Where is locate this vardefs file ?

    Because this is not a native field i imagine that this code is not in the /modules/Cases vardefs file.

    Where are locate the vardefs related do new fields created by the user.

    Thanks
    Ah good question

    My field was on a custom module so it was in vardefs

    I also changed a field in Tasks but again not a custom field

    The field definitions for custom fields are held in the database table fields_metadata

    You could try changing the type there then doing a rebuild and seeing if that works
    Mike Solomon
    Development Manager
    Ivy Ltd
    www.ivy.ltd.uk]www.ivy.ltd.uk

    php version 5.2.6
    MySql 5.1.59

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Problem on Step 7 of Install
    By ChrisA2107 in forum Installation and Upgrade Help
    Replies: 2
    Last Post: 2007-08-20, 08:31 AM
  2. problemi step 6 di SugarSuite-Full-4.0.1h
    By lucia in forum Italiano
    Replies: 0
    Last Post: 2006-12-27, 08:50 AM
  3. Replies: 1
    Last Post: 2006-10-12, 12:07 AM
  4. 4.0.1 Installation Problem
    By clawton in forum Help
    Replies: 14
    Last Post: 2006-02-13, 04:17 PM
  5. Fatal error: Max
    By spokes2k4 in forum Help
    Replies: 3
    Last Post: 2006-01-15, 03:50 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
  •