Results 1 to 9 of 9

Thread: Making required filed not required?

  1. #1
    miavfw is offline Sugar Community Member
    Join Date
    Jan 2008
    Posts
    21

    Default Making required field not required?

    I would like to change some of the required field (amount, estimated closed date) to non-required in the opportunities module. This makes sense for my application as I my opportunities have neither amounts nor estimated close dates and I don't use the reports.

    I found the following thread from my research on the forum http://www.sugarcrm.com/forums/showthread.php?t=7160

    Do I edited the modules/Opportunities//fields_array.php and replaced the line:

    required_fields' => Array('name'=>1, 'date_closed'=>2, 'amount'=>3, 'sales_stage'=>4, 'account_name'=>5),

    by

    'required_fields' => Array('name'=>1, 'sales_stage'=>2, 'account_name'=>3),

    I still get errors ("Missing required field: Expected Close Date" and "Missing required field: Amount") when I try to create an opportunity without either of these fields?

    Any suggestions?

    Thanks,

    Denis
    Last edited by miavfw; 2008-04-10 at 10:20 PM.

  2. #2
    dpatech is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    NC
    Posts
    287

    Default Re: Making required filed not required?

    It looks like you have to make this change in modules/Opportunities/metadata/editviewdefs.php (or possibly in custom/modules/Opportunities/metadata/editviewdefs.php).

    Change:
    PHP Code:
        array (
          
    'account_name',
          array( 
    'name'=>'amount','displayParams'=>array('required'=>true)),
        ),
        
        array (
          
    'opportunity_type',
          array(
    'name'=>'date_closed''displayParams'=>array('required'=>true)),
        ), 
    to this - which removes the "required" attribute for the two fields in question.

    PHP Code:
        array (
          
    'account_name''amount',
        ),
        
        array (
          
    'opportunity_type''date_closed',
        ), 
    - Sugar Team
    dpa Technology LLC
    e-mail: dpaDeveloper@dpatechnology.com
    web: http://www.dpatechnology.com

  3. #3
    miavfw is offline Sugar Community Member
    Join Date
    Jan 2008
    Posts
    21

    Default Re: Making required filed not required?

    Sorry for the late reply, but I forgot to subscribe to the thread so I didn't notice the answer.

    I looked at the modules/Opportunities/metadata/editviewdefs.php file, but there is no field listed that remotely resemble either "amount" or "estimated closed date". The file I was referring to in my original posting was modules/Opportunities/field_arrays.php per some other thread on this forum.

    Any suggestions?

  4. #4
    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: Making required filed not required?

    Hi, miavfw

    Does not it works??

    PHP Code:
     array (
          
    'amount',
          array( 
    'name'=>'amount','displayParams'=>array('required'=>false)),
        ), 
    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.

  5. #5
    SugarDev.net is offline Sugar Community Member
    Join Date
    Feb 2008
    Posts
    1,401

    Default Re: Making required filed not required?

    It's not the displayParams I think, it's the vardefs.php you have to override...

    -> required = false
    Developers go here
    Businesses go there (Dutch)

    Modules:
    SugarDev.net Developer Tools | Config | Dutch Language Pack
    "Nothing gets fixed unless there is a bug"

  6. #6
    miavfw is offline Sugar Community Member
    Join Date
    Jan 2008
    Posts
    21

    Default Re: Making required field not required?

    So far no luck... here is what I have changed:

    in modules/Opportunities/field_arrays.php

    Replaced:
    'required_fields' => Array('name'=>1, 'date_closed'=>2, 'amount'=>3, 'sales_stage'=>4, 'account_name'=>5),
    by
    'required_fields' => Array('name'=>1, 'sales_stage'=>4, 'account_name'=>5),
    in modules/Opportunities/metadata/editviewdefs.php

    Replaced:
    array (
    'account_name',
    array( 'name'=>'amount','displayParams'=>array('required' =>true)),
    ),

    array (
    'opportunity_type',
    array('name'=>'date_closed', 'displayParams'=>array('required'=>true)),
    ),
    by
    array (
    'account_name',
    array( 'name'=>'amount','displayParams'=>array('required' =>false)),
    ),

    array (
    'opportunity_type',
    array('name'=>'date_closed', 'displayParams'=>array('required'=>false)),
    ),
    and in modules/Opportunities/vardefs.php

    Replaced:
    'amount_usdollar' =>
    array (
    'name' => 'amount_usdollar',
    'vname' => 'LBL_AMOUNT_USDOLLAR',
    'type' => 'currency',
    'group'=>'amount',
    'dbType' => 'double',
    'disable_num_format' => true,
    'audited'=>true,
    'comment' => 'Formatted amount of the opportunity'
    ),
    ...
    'date_closed' =>
    array (
    'name' => 'date_closed',
    'vname' => 'LBL_DATE_CLOSED',
    'type' => 'date',
    'audited'=>true,
    'comment' => 'Expected or actual date the oppportunity will close'
    ),
    by:

    'amount_usdollar' =>
    array (
    'name' => 'amount_usdollar',
    'vname' => 'LBL_AMOUNT_USDOLLAR',
    'type' => 'currency',
    'group'=>'amount',
    'dbType' => 'double',
    'disable_num_format' => true,
    'audited'=>true,
    'comment' => 'Formatted amount of the opportunity'
    'required' => false,
    ),
    ...
    'date_closed' =>
    array (
    'name' => 'date_closed',
    'vname' => 'LBL_DATE_CLOSED',
    'type' => 'date',
    'audited'=>true,
    'comment' => 'Expected or actual date the oppportunity will close'
    'required' => false,
    ),
    Still not working though!

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

    Default Re: Making required filed not required?

    Which version do you use?

  8. #8
    miavfw is offline Sugar Community Member
    Join Date
    Jan 2008
    Posts
    21

    Default Re: Making required filed not required?

    Quote Originally Posted by kuske
    Which version do you use?
    I am running 5.0.0a

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

    Default Re: Making required filed not required?

    Did you call the "admin" - "repair" - "Clear Vardefs Data Cache" function after your changes?
    Only by ths function you will regenerate the JavaScript files for the panel layouts.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Importing data from ACT, making last name not required
    By wby in forum General Discussion
    Replies: 10
    Last Post: 2010-04-09, 06:07 PM
  2. Replies: 1
    Last Post: 2008-01-23, 10:12 PM
  3. Replies: 7
    Last Post: 2007-07-13, 01:38 PM
  4. Replies: 3
    Last Post: 2007-02-28, 02:45 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
  •