Results 1 to 7 of 7

Thread: Modify/Change Required Field Atribute

  1. #1
    masmith is offline Senior Member
    Join Date
    Jul 2008
    Posts
    27

    Default Modify/Change Required Field Atribute

    Hi.

    In the Lead menu/page, the Last Name is shown as being required. Is there a way to change the required (*) attribute to a normal use. IE, can the (*) be removed from the item.

    The Studio module for the Lead/Fields seems to show a checkbox for "required", but the box can't be changed.

    Using, Fedora8, MysSQL4.0, Sugar5

    thanks

    -marl
    caliventures@yahoo.com

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

    Default Re: Modify/Change Required Field Atribute

    Quote Originally Posted by masmith
    Hi.

    In the Lead menu/page, the Last Name is shown as being required. Is there a way to change the required (*) attribute to a normal use. IE, can the (*) be removed from the item.

    The Studio module for the Lead/Fields seems to show a checkbox for "required", but the box can't be changed.

    Using, Fedora8, MysSQL4.0, Sugar5

    thanks

    -marl
    caliventures@yahoo.com
    you can change it in vardefs
    Mike Solomon
    Development Manager
    Ivy Ltd
    www.ivy.ltd.uk]www.ivy.ltd.uk

    php version 5.2.6
    MySql 5.1.59

  3. #3
    masmith is offline Senior Member
    Join Date
    Jul 2008
    Posts
    27

    Default Re: Modify/Change Required Field Atribute

    umm...

    thanks.. but where is vardefs!! can't find it via google!

    thanks

    -mark
    caliventures@yahoo.com

  4. #4
    eggsurplus's Avatar
    eggsurplus is offline Sugar Community Member
    Join Date
    Dec 2005
    Location
    Minnesota
    Posts
    2,343

    Default Re: Modify/Change Required Field Atribute

    Quick How To: (would be good to have a way to post a reply to a wiki article. not wasting the time to do this twice)
    ------------------
    NOTE: Upgrade Safe
    NOTE 2: Normal method of just overriding the vardefs does not work in this case because this field being required is defined at the view level and not the data level. Usually vardefs do handle this and if that were the case you'd do the following:
    1. Create a file in custom\Extension\modules\Leads\Ext\Vardefs called anything you want followed by .php: caliventures.php
    2. Open the file and put this code in it:
    PHP Code:
    <?php

    $dictionary
    ['Lead']['fields']['last_name']['required'] = 'false';

    ?>
    3. Go to Admin->Repair->Quick Repair and Rebuild, choose Leads, and leave all checked. This rebuilds the vardefs. You'll see your code in custom\modules\Leads\Ext\Vardefs\vardefs.ext.php now if successful along with the requirement being gone.

    But since that doesn't work here (last_name is inherited from the person SugarObject which is not required by default) we have to do this instead:
    1. Copy modules\Leads\metadata\editviewdefs.php to custom\modules\Leads\metadata\
    2. Open and find this code:
    PHP Code:
          array('name'=>'last_name',
                
    'displayParams'=>array('required'=>true),
          ), 
    3. Remove the displayparams line:
    PHP Code:
          array('name'=>'last_name',
          ), 
    4. Save and go to Admin->Repair->Quick Repair and Rebuild, choose Leads, and leave all checked.


    First post is free

  5. #5
    masmith is offline Senior Member
    Join Date
    Jul 2008
    Posts
    27

    Default Re: Modify/Change Required Field Atribute

    Aha!!!

    So I wasn't loosing my mind!!! It is/was a code change!i

    I looked high/low thinking that there was a button somewhere, or a dialog someplace that I needed to select to change the basic defs/vars..


    Thanks....

    -mark
    caliventures@yahoo.com

  6. #6
    trhermes is offline Junior Member
    Join Date
    Sep 2008
    Posts
    1

    Default Re: Modify/Change Required Field Atribute

    I made an attempt at this method with the Contacts module to no avail. Where else might I look to remove the required last name field?

  7. #7
    veng is offline Junior Member
    Join Date
    May 2009
    Posts
    1

    Wink Re: Modify/Change Required Field Atribute

    Hi,
    I just got with this need and solved following these steps at source code level:
    Beside changes at EditView.html in order to get * requiered label style (read previous post)
    1. walk into module to change (Leads) modules/Leads
    2. edit field_arrays.php
    3. Add into 'required_fields' => array(
    "first_name"=> 1,
    "last_name" => 1
    ) ,
    4. Save field_arrays.php

    I need to add requierement attribute to first name field, but you just can delete last_name from array.
    Hope to be helpful

    Cheers!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 2008-03-18, 11:35 AM
  2. Module Builder Required Field
    By wkcarlson in forum Developer Help
    Replies: 0
    Last Post: 2008-01-29, 07:31 PM
  3. Replies: 4
    Last Post: 2007-08-24, 10:17 AM
  4. Replies: 7
    Last Post: 2007-07-13, 01:38 PM
  5. Replies: 1
    Last Post: 2007-02-21, 06:32 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
  •