Results 1 to 6 of 6

Thread: Custom Date field that auto-populates

  1. #1
    jeffreyvsmith is offline Sugar Community Member
    Join Date
    Oct 2005
    Posts
    72

    Default Custom Date field that auto-populates

    SugarCRM 4.0.0
    PHP 5.1.6
    MySQL 5.0.27
    FC6 2.6.22.4-45.fc6

    Wanting to create a custom field for the Cases module that is a date field that has a default value of a week away. For example I want the field's default value to be date --date "`date` 7 days" '+%m/%d/%y'..

    Not being a programmer, is this something I can just put in a php file or an html file somewhere?

  2. #2
    kuske's Avatar
    kuske is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Germany
    Posts
    2,597

    Default Re: Custom Date field that auto-populates

    Hi,
    what about creating a custom field with default value in 1 week?

    admin - studio - edit a module - cases - edit custom fields - create custom field:

    Set
    - data type = date
    - field name
    - field label
    - help text
    - default value = next week
    - audit (to see if anybody changes this field)
    ...
    and save.

    edit layout:

    add the field to the detail view AND to the edit view (very important because the calculation is done in the edit view).

    regards
    hk

  3. #3
    jeffreyvsmith is offline Sugar Community Member
    Join Date
    Oct 2005
    Posts
    72

    Default Re: Custom Date field that auto-populates

    When you say default value = next week, are you saying to literally type in "next week" or to type the date, e.g. 11/6/2007. I tried entering "next week" in the default value for the field, but when I create a case the box is blank, no default value appears

  4. #4
    kuske's Avatar
    kuske is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Germany
    Posts
    2,597

    Default Re: Custom Date field that auto-populates

    You must add the field to the Edit View Panel.
    Only then it will be set to a date 7 days later (next week).
    The Edit View does the real job of initializing.

  5. #5
    jeffreyvsmith is offline Sugar Community Member
    Join Date
    Oct 2005
    Posts
    72

    Default Re: Custom Date field that auto-populates

    So, I create the custom field, set the default value equal to "next week". I modify the layout of Cases/Editview. But, when I click to create a case, the value of the field is blank. I can click the calendar icon and choose a date, but I need it to default to a week from the current date when someone clicks new case....Thoughts?

  6. #6
    kuske's Avatar
    kuske is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Germany
    Posts
    2,597

    Default Re: Custom Date field that auto-populates

    Mmmm, in my installation it populates....
    Did you add it to DetailView AND EditView Panel?
    The mechanism only works for NEW items, already existing items leave empty.
    I do not really know why it should not work in your installation.
    Try to create an other new filed of that kind.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. upgraded to 4.5.1e, received "Metadata for table tracker does not exist"
    By sfgeorge in forum Installation and Upgrade Help
    Replies: 0
    Last Post: 2007-09-03, 02:24 PM
  2. Date & Time custom field
    By JimMurple in forum Developer Help
    Replies: 1
    Last Post: 2007-04-11, 11:59 AM
  3. Asterisk Patch 1.1.0 Crash on logon
    By skyracer in forum Help
    Replies: 6
    Last Post: 2006-07-08, 06:30 AM
  4. Replies: 1
    Last Post: 2006-06-16, 03:35 AM
  5. Replies: 7
    Last Post: 2006-06-06, 07: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
  •