Re: Making a field not 'required'
Hi,
Issue 1: Making Contact name optional. Well i looked into it and saw that this field is required by Contact n Lead.
Tried the traditional method of making a field optional in cutom/Extension/modules/contact/Ext/vardefs/
but failed!
Issue 2: How to make the Account for Lead Converted optional.
Well you need to copy the
modules/Leads/ConvertLead.php
modules/Leads/ConvertLead.tpl
into
custom/modules/Leads/ConvertLead.php
custom/modules/Leads/ConvertLead.tpl
in ConvertLead.php
find all the line echo $sugar_smarty->fetch('modules/Leads/ConvertLead.tpl');
and change it to echo $sugar_smarty->fetch('custom/modules/Leads/ConvertLead.tpl');
in the ConvertLead.tpl file in the custom/modules/Leads/
In the beginning you will find
<span class="color">{$ERROR}</span>
<script>
function isChecked(field) {ldelim}
return eval("document.forms['ConvertLead']."+field+".checked");
{rdelim}
function checkOpportunity(){ldelim}
if(!isChecked('newopportunity')){ldelim}
return true;
{rdelim}
removeFromValidate('ConvertLead', 'Opportunitiesaccount_name');
if(validate_form('ConvertLead', 'Opportunities')){ldelim}
if(this.document.forms['ConvertLead'].selectedAccount.value != ''){ldelim}
return true;
{rdelim}
if(!isChecked('newaccount')){ldelim}
alert('{$OPPNEEDSACCOUNT}');
return false;
{rdelim}
return true;
{rdelim}
return false;
{rdelim}
</script>
{$DUPLICATEFORMBODY}
Change it to:
<span class="color">{$ERROR}</span>
<script>
function isChecked(field) {ldelim}
return eval("document.forms['ConvertLead']."+field+".checked");
{rdelim}
function checkOpportunity(){ldelim}
if(!isChecked('newopportunity')){ldelim}
return true;
{rdelim}
removeFromValidate('ConvertLead', 'Opportunitiesaccount_name');
if(validate_form('ConvertLead', 'Opportunities')){ldelim}
if(this.document.forms['ConvertLead'].selectedAccount.value != ''){ldelim}
return true;
{rdelim}
if(!isChecked('newaccount')){ldelim}
//alert('{$OPPNEEDSACCOUNT}');
return true;
{rdelim}
return true;
{rdelim}
return false;
{rdelim}
</script>
{$DUPLICATEFORMBODY}
This will lead you convert the lead without the need of an account for the lead.
This will solve your second issue.
If you come to know hoe to solve first issue do all know.
Hope it is helpful !!!
If It Is To Be, It Is Up To Me
Bookmarks