Results 1 to 3 of 3

Thread: How to add default text to the description/resolution fields

  1. #1
    samuelwright is offline Junior Member
    Join Date
    May 2010
    Posts
    3

    Default How to add default text to the description/resolution fields

    This is pretty basic but:

    How do I add default text to the description and resolution fields within "Cases" using Studio?

    I'm looking to add a timestamp in the resolution, so that each time it is edited a date and time appears in the top row of text. I.e

    06-07-2010 17:56 ##:

    Help much appreciated.

  2. #2
    jjwdesign's Avatar
    jjwdesign is offline Sugar Community Member
    Join Date
    Dec 2006
    Location
    Orlando, FL
    Posts
    503

    Default Re: How to add default text to the description/resolution fields

    I believe you would want to tie that kind of logic into a "logic hook" so that it's upgrade safe. Check out:

    http://www.sugarcrm.com/wiki/index.p...le=Logic_Hooks
    SugarForge Projects:
    JJWDesign Google Maps
    JJWDesign Tools and Reports

    Follow my blog postings at JJW Design.

  3. #3
    jjwdesign's Avatar
    jjwdesign is offline Sugar Community Member
    Join Date
    Dec 2006
    Location
    Orlando, FL
    Posts
    503

    Default Re: How to add default text to the description/resolution fields

    Here's an example logic hook ("before_save") I used to manipulate a date-time field based on another input field. This might give you some ideas of what is possible.

    PHP Code:
    <?php
    // custom/modules/Leads/LeadLogicHook.php
    if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');

    class 
    LeadLogicHook {

    // $sugar_config['default_date_format']
    // $sugar_config['default_time_format']

        
    function updateDateEntered(&$bean$event$arguments) {

            global 
    $current_user$sugar_config;
            
    $udf $current_user->getPreference('datef');
            if (
    $udf == "") {
                
    $udf $sugar_config['default_date_format'];
            }
            
    // Update the date_entered field based on entered_override_c field.
            
    if (!empty($bean->entered_override_c)) {
                
    $bean->date_entered gmdate("Y-m-d"strtotime($bean->entered_override_c))." 16:11:11";
                
    $bean->entered_override_c '';
            } 
    // if not empty
        
    // end of updateDateEntered

    // end class
    SugarForge Projects:
    JJWDesign Google Maps
    JJWDesign Tools and Reports

    Follow my blog postings at JJW Design.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 4
    Last Post: 2010-04-26, 09:11 PM
  2. Replies: 0
    Last Post: 2010-04-13, 10:31 PM
  3. Replies: 0
    Last Post: 2009-06-25, 08:42 AM
  4. Replies: 7
    Last Post: 2009-04-16, 11:24 PM
  5. [Visit Reports] Default Description Template
    By techex in forum Feature Requests
    Replies: 1
    Last Post: 2005-11-11, 01:14 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
  •