How to customize field in crm(Make field mandatory)
How to customize field in crm(Make field mandatory)
Hello sadique,
to make a custom field required, go into studio, click into the module --> fields, and click on the custom field. A new window will appear when you can check off the 'Required Field' checkbox. click save.
For out of the box fields, you cannot do the above. You have to set them to required in the code:
custom/Extension/modules/[MODULE NAME]/Ext/Vardefs/[FILENAME].php
PHP Code:$dictionary['MODULE NAME']['fields']['FIELDNAME']['required'] = true;
then go to the admin area and click Repair and Quick Repair and Rebuild
Intelestream has a great deal of experience hosting and customizing the SugarCRM application. Our company is made up by former employees of SugarCRM, and together we have over 50 years of experience working with the application. To learn more about us, please visit our website at www.intelestream.net or contact us directly at 800-391-4055 or by email at info@intelestream.net
Hi guys
Instead of modifying the vardefs itself you may set the attribute:
Into field definition at the custom/modules/<ModuleName>/metadata/editviewdefs.phpPHP Code:'displayParams' => array('required' => true),
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.
I have tried this except in the opposite direction. Can't seem to get it to work.
Tried Clint's suggestion too in another .
Due to some customization we would like to leave the client link in the Opportunities module just not make it required, as they will be working with Leads and opportunities.
How can I turn off that required field in a way that will be upgrade safe. The vardefs.ext.php gets rewritten each repair so it can't go there and doesn't work anyway. Tried the suggested displayParams as suggested above. gets rid of the red dot but not the requiredness!
Will just have to delete the field if can't get this to work.
Thanks Paris
info: Sugar 5.1b
custom/Extension/modules/Opportunity/Ext/Vardefs/vardefs.ext.php and example.php
$dictionary['Opportunity']['fields']['account_name'']['required'] = false;
Also tried it in the /modules/Opportunity/vardefs.php no luck...
I will keep playing hopefully one of the experts can clear this up.
Paris
Hi All,
I've tried the solution posted by andopes and it works properly for standard fields!
Now I'm looking for a way to make required City and States about Accounts module,
those fields are within the "Address" object field and I have no idea where put my hands
Can someone help me please?
Thanks a lot,
Max
Hi
To make the city or state required
go to custom/modules/Accounts/metadata/editvewdefs.php
then add the highlighted line
'lbl_address_information' =>
array (
0 =>
array (
0 =>
array (
'name' => 'billing_address_street',
'hideLabel' => true,
'type' => 'address',
'displayParams' =>
array (
'key' => 'billing',
'rows' => 2,
'cols' => 30,
'maxlength' => 150,
'required' => array('billing_address_city','billing_address_coun try'),
),
'label' => 'LBL_BILLING_ADDRESS_STREET',
),
Then quick repair and rebuild
ShamimWilson
shamim.797@gmail.com.
Have a look at this thread.
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.
Hi,
I'm sorry for the my answer delay but I forgot to subscribe this thread
btw I followed the ShamimWilson instructions and I have City and State mandatory now.
Thanks a lot to andopes and ShamimWilson for the support.
Max
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks