Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Edit Case Module

  1. #1
    raw_enha is offline Member
    Join Date
    Mar 2010
    Posts
    8

    Default Edit Case Module

    Using: Sugar Community Edition 5.5.0

    I added a field to Cases Status dropdown called "-blank-" [default empty entry type].
    Sugar, correctly, defaults to the empty entry for Status in Cases when creating a new case.
    I want to make "Status" required, so the user has to choose one of the entries. I've successfully done this on custom fields, but cant' do it on Sugar Default Fields. Any help is appreciated, thank you

  2. #2
    salesagility's Avatar
    salesagility is offline Sugar Community Member
    Join Date
    Aug 2006
    Location
    UK
    Posts
    2,379

    Default Re: Edit Case Module

    edit custom/modules/{modulename}/metadata/editviewdefs.php and add:

    'field' => 'field_name', 'displayParams' => array ( 'required' => true, ),

    Then quick repair/rebuild.

  3. #3
    AlexAv's Avatar
    AlexAv is offline Sugar Community Member
    Join Date
    Oct 2009
    Location
    Ukraine
    Posts
    922

    Default Re: Edit Case Module

    Edit
    ..custom/modules/Cases/metadata/editviewdefs.php

    or

    ../modules/Cases/metadata/editviewdefs.php
    PHP Code:
    ...
         array (
            array(
    'name'=>'status''displayParams'=>array('required'=>true)) ,
          ),
    ... 
    Then Admin->Clear Template Data Cache
    Letrium ltd. - Only high quality service
    http://letrium.com

  4. #4
    raw_enha is offline Member
    Join Date
    Mar 2010
    Posts
    8

    Default Re: Edit Case Module

    Thank you both.
    I have followed the instructions, but there is no change in behavior.
    If I create a blank case and simply try to click "Save" all required fields that have a blank default value turn red with a red note: "Missing required field: 'field'"

    but the "Status" field shows no such message and remains white with the default blank entry.

    I had entered the following in the Status field section of custom/modules/Cases/metadata/editviewdefs.php
    AND to Status field section of: /modules/Cases/metadata/editviewdefs.php

    From the files:

    -----From custom/modules/Cases/metadata/editviewdefs.php-----

    array (
    0 =>
    array (
    'name' => 'status',
    'comment' => 'The status of the case',
    'label' => 'LBL_STATUS',
    array (
    array('name'=>'status', 'displayParams'=>array('required'=>true)) ,
    ),
    ),

    -----From modules/Cases/metadata/editviewdefs.php-----

    array (
    'status',
    'account_name',
    array (
    array('name'=>'status', 'displayParams'=>array('required'=>true)) ,
    ),
    ),


    -----------------------------------------

    Right now, both files are modified, no other adverse effects, but the desired effect remains absent

  5. #5
    AlexAv's Avatar
    AlexAv is offline Sugar Community Member
    Join Date
    Oct 2009
    Location
    Ukraine
    Posts
    922

    Default Re: Edit Case Module

    Quote Originally Posted by raw_enha View Post
    Thank you both.
    I have followed the instructions, but there is no change in behavior.
    If I create a blank case and simply try to click "Save" all required fields that have a blank default value turn red with a red note: "Missing required field: 'field'"

    but the "Status" field shows no such message and remains white with the default blank entry.

    I had entered the following in the Status field section of custom/modules/Cases/metadata/editviewdefs.php
    AND to Status field section of: /modules/Cases/metadata/editviewdefs.php

    From the files:

    -----From custom/modules/Cases/metadata/editviewdefs.php-----

    array (
    0 =>
    array (
    'name' => 'status',
    'comment' => 'The status of the case',
    'label' => 'LBL_STATUS',
    array (
    array('name'=>'status', 'displayParams'=>array('required'=>true)) ,
    ),
    ),

    -----From modules/Cases/metadata/editviewdefs.php-----

    array (
    'status',
    'account_name',
    array (
    array('name'=>'status', 'displayParams'=>array('required'=>true)) ,
    ),
    ),


    -----------------------------------------

    Right now, both files are modified, no other adverse effects, but the desired effect remains absent

    Try this
    PHP Code:
    ...
          
    =>  array (
            array(
    'name'=>'status''label' => 'LBL_STATUS''displayParams'=>array('required'=>true)) ,
          ),
    ... 
    Letrium ltd. - Only high quality service
    http://letrium.com

  6. #6
    raw_enha is offline Member
    Join Date
    Mar 2010
    Posts
    8

    Default Re: Edit Case Module

    Hi AlexAv,

    When I try to create a case, I get
    Parse error: syntax error, unexpected ',' in /homepages/38/d190896601/htdocs/outtech/net/portal/crm/custom/modules/Cases/metadata/editviewdefs.php on line 184

    Here is the entire "Status" section of: custom/modules/cases/metadata/editviewdefs.php

    1 =>
    array (
    0 => array (
    array('name'=>'status',
    'label' => 'LBL_STATUS',
    'comment' => 'The status of the case',
    'displayParams'=>array('required'=>true)) ,
    ),
    ),

  7. #7
    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: Edit Case Module

    Please, attach the full script into your next post.

    Regards
    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.

  8. #8
    raw_enha is offline Member
    Join Date
    Mar 2010
    Posts
    8

    Default Re: Edit Case Module

    andropes,

    attached is full file of editviewdefs.php from custom/modules/cases/metadata/editviewdefs.php
    ---------------

    also pasted:
    ---------------


    <?php
    $viewdefs ['Cases'] =
    array (
    'EditView' =>
    array (
    'templateMeta' =>
    array (
    'maxColumns' => '2',
    'widths' =>
    array (
    0 =>
    array (
    'label' => '10',
    'field' => '30',
    ),
    1 =>
    array (
    'label' => '10',
    'field' => '30',
    ),
    ),
    ),
    'panels' =>
    array (
    'default' =>
    array (
    0 =>
    array (
    0 =>
    array (
    'name' => 'case_number',
    'type' => 'readonly',
    'displayParams' =>
    array (
    'required' => true,
    ),
    ),
    1 =>
    array (
    'name' => 'priority',
    'comment' => 'The priority of the case',
    'label' => 'LBL_PRIORITY',
    ),
    ),
    1 =>
    array (
    0 =>
    array (
    array ('name' => 'status',
    'comment' => 'The status of the case',
    'label' => 'LBL_STATUS',
    'displayParams'=>array('required'=>true)) ,
    ),
    ),
    1 =>
    array (
    'name' => 'assigned_user_name',
    'label' => 'LBL_ASSIGNED_TO_NAME',
    ),
    ),
    2 =>
    array (
    0 =>
    array (
    'name' => 'type',
    'comment' => 'The type of issue (ex: issue, feature)',
    'label' => 'LBL_TYPE',
    ),
    1 =>
    array (
    'name' => 'account_name',
    'comment' => 'The name of the account represented by the account_id field',
    'label' => 'LBL_ACCOUNT_NAME',
    ),
    ),
    3 =>
    array (
    0 =>
    array (
    'name' => 'case_contact_c',
    'label' => 'LBL_CASE_CONTACT',
    ),
    1 =>
    array (
    'name' => 'call_back_number_c',
    'label' => 'LBL_CALL_BACK_NUMBER',
    ),
    ),
    4 =>
    array (
    0 =>
    array (
    'name' => 'service_date_c',
    'label' => 'LBL_SERVICE_DATE',
    ),
    1 =>
    array (
    'name' => 'total_service_time_c',
    'label' => 'LBL_TOTAL_SERVICE_TIME',
    ),
    ),
    5 =>
    array (
    0 =>
    array (
    'name' => 'start_time_c',
    'label' => 'LBL_START_TIME',
    ),
    1 =>
    array (
    'name' => 'end_time_c',
    'label' => 'LBL_END_TIME',
    ),
    ),
    6 =>
    array (
    0 =>
    array (
    'name' => 'service_location_c',
    'studio' => 'visible',
    'label' => 'LBL_SERVICE_LOCATION',
    ),
    1 =>
    array (
    'name' => 'trip_fee_c',
    'studio' => 'visible',
    'label' => 'LBL_TRIP_FEE',
    ),
    ),
    7 =>
    array (
    0 =>
    array (
    'name' => 'name',
    'displayParams' =>
    array (
    'size' => 75,
    'required' => true,
    ),
    ),
    1 =>
    array (
    'name' => 'service_type_c',
    'studio' => 'visible',
    'label' => 'LBL_SERVICE_TYPE',
    ),
    ),
    8 =>
    array (
    0 =>
    array (
    'name' => 'description',
    'displayParams' =>
    array (
    'rows' => '8',
    'cols' => '80',
    ),
    'nl2br' => true,
    ),
    ),
    9 =>
    array (
    0 =>
    array (
    'name' => 'work_log',
    'comment' => 'Free-form text used to denote activities of interest',
    'label' => 'LBL_WORK_LOG',
    ),
    ),
    10 =>
    array (
    0 =>
    array (
    'name' => 'resolution',
    'displayParams' =>
    array (
    'rows' => '5',
    'cols' => '80',
    ),
    'nl2br' => true,
    ),
    ),
    ),
    ),
    ),
    );
    ?>
    Attached Files Attached Files

  9. #9
    AlexAv's Avatar
    AlexAv is offline Sugar Community Member
    Join Date
    Oct 2009
    Location
    Ukraine
    Posts
    922

    Default Re: Edit Case Module

    Remove one array(...).

    PHP Code:
    ...
    array (

              
    => 
                array (
    'name' => 'status',
                
    'comment' => 'The status of the case',
                
    'label' => 'LBL_STATUS',
            
    'displayParams'=>array('required'=>true)) , 
              ),


              
    => 
              array (
                
    'name' => 'assigned_user_name',
                
    'label' => 'LBL_ASSIGNED_TO_NAME',
              ),

            ),
    ... 
    Last edited by AlexAv; 2010-03-05 at 10:00 AM.
    Letrium ltd. - Only high quality service
    http://letrium.com

  10. #10
    raw_enha is offline Member
    Join Date
    Mar 2010
    Posts
    8

    Default Re: Edit Case Module

    AlexAv,

    With your change I get this when clicking on "create case":

    Parse error: syntax error, unexpected ',' in /homepages/38/d190896601/htdocs/outtech/net/portal/crm/custom/modules/Cases/metadata/editviewdefs.php on line 183



    -----------------------
    Attached is the file
    Attached Files Attached Files

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Edit the closed case
    By shamimwilson in forum Developer Help
    Replies: 0
    Last Post: 2009-08-04, 02:40 PM
  2. Replies: 2
    Last Post: 2008-10-17, 03:32 PM
  3. task from case - view.edit location
    By mikesolomon in forum Help
    Replies: 0
    Last Post: 2008-05-01, 10:02 AM
  4. Portal Case edit
    By jbusna in forum Developer Help
    Replies: 1
    Last Post: 2008-01-14, 06:08 PM
  5. Replies: 5
    Last Post: 2007-05-21, 12:59 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
  •