Results 1 to 9 of 9

Thread: How to customize field in crm(Make field mandatory)

  1. #1
    sadique is offline Junior Member
    Join Date
    Jun 2008
    Posts
    1

    Default How to customize field in crm(Make field mandatory)

    How to customize field in crm(Make field mandatory)

  2. #2
    sugarcane is offline Sugar Community Member
    Join Date
    Apr 2005
    Location
    Chicago, IL
    Posts
    1,207

    Default Re: 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

  3. #3
    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: How to customize field in crm(Make field mandatory)

    Hi guys

    Instead of modifying the vardefs itself you may set the attribute:
    PHP Code:
    'displayParams' => array('required' => true), 
    Into field definition at the custom/modules/<ModuleName>/metadata/editviewdefs.php

    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.

  4. #4
    ptemplin7 is offline Sugar Community Member
    Join Date
    Jun 2007
    Location
    Puget Sound Washington
    Posts
    380

    Question Re: How to customize field in crm(Make field mandatory)

    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;

  5. #5
    ptemplin7 is offline Sugar Community Member
    Join Date
    Jun 2007
    Location
    Puget Sound Washington
    Posts
    380

    Default Re: How to customize field in crm(Make field mandatory)

    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

  6. #6
    maxpax's Avatar
    maxpax is offline Member
    Join Date
    Mar 2009
    Location
    Viareggio - Italy
    Posts
    9

    Thumbs up Re: How to customize field in crm(Make field mandatory)

    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

  7. #7
    shamimwilson is offline Sugar Community Member
    Join Date
    Mar 2009
    Location
    Banglore India
    Posts
    235

    Default Re: How to customize field in crm(Make field mandatory)

    Quote Originally Posted by maxpax View Post
    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.

  8. #8
    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: How to customize field in crm(Make field mandatory)

    Quote Originally Posted by maxpax View Post
    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
    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.

  9. #9
    maxpax's Avatar
    maxpax is offline Member
    Join Date
    Mar 2009
    Location
    Viareggio - Italy
    Posts
    9

    Default Re: How to customize field in crm(Make field mandatory)

    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

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 2008-01-21, 09:22 AM
  2. Replies: 7
    Last Post: 2007-07-13, 01:38 PM
  3. How to make a field mandatory
    By nauliv in forum Help
    Replies: 3
    Last Post: 2006-11-15, 08:37 PM
  4. Bug in creating mandatory field
    By ejc in forum Help
    Replies: 1
    Last Post: 2005-12-05, 06:22 PM
  5. Make a field mandatory
    By nauliv in forum Help
    Replies: 0
    Last Post: 2005-03-30, 06:14 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
  •