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
Bookmarks