Results 1 to 8 of 8

Thread: making billing address required

  1. #1
    dangeorge6 is offline Member
    Join Date
    Sep 2009
    Posts
    9

    Default making billing address required

    Hi,

    I need to make the billing address fields required for Accounts. I have v 5.2.0j and have installed sugar on my own server. I looked at the wiki method here http://www.sugarcrm.com/wiki/index.p...n_SugarCRM_5.0. Problem is, it wants me to edit a file in {sugarroot}/custom/Extension/modules/{module name}/Ext/Vardefs and there is no {sugarroot}/custom/Extension/modules/Accounts folder on my installation. I only see a {sugarroot}/custom/Extension/modules/Administration folder. I tried creating the directories I needed but when I repaired, Studio would no longer load. Why don't I have the folders specified?

    Danny

  2. #2
    Angel's Avatar
    Angel is offline Sugar Community Member
    Join Date
    Jul 2005
    Location
    Los Angeles
    Posts
    4,813

    Default Re: making billing address required

    You need to create both the folder structure and the file (assuming it doesn't exist).

    Not sure why creating it would break your Studio feature, but what happens if you delete the folder you created? Does it then make Studio functional?
    Regards,

    Angel Magaņa
    Co-Author: Implementing SugarCRM 5.x (Packt Publishing -- Sept. 2010)
    Blog: http://cheleguanaco.blogspot.com.
    Twitter: @cheleguanaco.

    ________
    | Projects: |_____________________________________
    |
    | CandyWrapper (.NET Wrapper for SugarCRM SOAP API). Source now available on GitHub!
    | GoldMine to SugarCRM Express Conversion. Latest: 1.0.1.7 (Nov. 3, 2009)
    | CRM SkyDialer (Skype Integration). Latest: 1.0.2 (Feb. 17, 2010)
    | Round Robin Leads Assignment
    | Phone Number Formatter
    | CaseTwit (Twitter Integration)
    ______________________________________________

  3. #3
    dangeorge6 is offline Member
    Join Date
    Sep 2009
    Posts
    9

    Default Re: making billing address required

    Ok, so I built the {sugarroot}/custom/Extension/modules/Accounts/Ext/Vardefs directory and put a file in there called RequiredVars.php. The file looks like this:
    PHP Code:
     <?php $dictionary['Accounts']['fields']['billing_address_street']['required']=true?>
     <?php $dictionary['Accounts']['fields']['billing_address_city']['required']=true?>
      <?php $dictionary['Accounts']['fields']['billing_address_state']['required']=true?>
       <?php $dictionary['Accounts']['fields']['billing_address_postalcode']['required']=true?>
    I then repaired extensions. It reparied fine and Studio has no issues, however no change has taken place. There are no red asterisks near the above fields, and you can create an account without these fields. Please help.

  4. #4
    Angel's Avatar
    Angel is offline Sugar Community Member
    Join Date
    Jul 2005
    Location
    Los Angeles
    Posts
    4,813

    Default Re: making billing address required

    Name your file vardefs.ext.php, then rebuild. Although, you might need to do some additional work as "address" fields are treated a bit different than other fields.

    If it doesn't work, try changing your vardefs.ext.php file to reference a different field, like title, then rebuild, to test and make sure that the syntax is correct.
    Regards,

    Angel Magaņa
    Co-Author: Implementing SugarCRM 5.x (Packt Publishing -- Sept. 2010)
    Blog: http://cheleguanaco.blogspot.com.
    Twitter: @cheleguanaco.

    ________
    | Projects: |_____________________________________
    |
    | CandyWrapper (.NET Wrapper for SugarCRM SOAP API). Source now available on GitHub!
    | GoldMine to SugarCRM Express Conversion. Latest: 1.0.1.7 (Nov. 3, 2009)
    | CRM SkyDialer (Skype Integration). Latest: 1.0.2 (Feb. 17, 2010)
    | Round Robin Leads Assignment
    | Phone Number Formatter
    | CaseTwit (Twitter Integration)
    ______________________________________________

  5. #5
    ros.vol is offline Sugar Community Member
    Join Date
    Dec 2008
    Location
    Eastern Europe / Ukraine / Chernivtsi
    Posts
    114

    Default Re: making billing address required

    Hello,

    You may set $displayParams with "required" value within your editviewdefs.php
    Rostyslav Volonchuk

    SugarCRM development and customizations

  6. #6
    dangeorge6 is offline Member
    Join Date
    Sep 2009
    Posts
    9

    Default Re: making billing address required

    I changed the filename to vardefs.ext.php and repaired. Still no luck. I then tried to make the website field required instead in the vardefs.ext.php file. Repaired. No luck getting the website field to be required.

    Earlier I did try playing around with that editviewdefs.php, putting in "required = true" but no luck. Any more ideas? How come I never had the folders I was supposed to have to begin with for the extensions/modules/Accounts?

  7. #7
    Angel's Avatar
    Angel is offline Sugar Community Member
    Join Date
    Jul 2005
    Location
    Los Angeles
    Posts
    4,813

    Default Re: making billing address required

    Couple of things...

    1. "Accounts" should be singular (Account)

    2. You will need to do a bit more than just the above in order to get it to apply the setting to the billing address field. Per my previous reply, address fields are handled differently, so the rules in the wiki article don't apply. In short, you will need to create a copy of the address field type, make your customization there, then define the address fields as the new address field type.

    3. The directories aren't there because the install process only creates the directories it needs to operate normally without any customizations. It is not abnormal behavior that they do not exist and the fact that they weren't there doesn't indicate that there is a problem.
    Regards,

    Angel Magaņa
    Co-Author: Implementing SugarCRM 5.x (Packt Publishing -- Sept. 2010)
    Blog: http://cheleguanaco.blogspot.com.
    Twitter: @cheleguanaco.

    ________
    | Projects: |_____________________________________
    |
    | CandyWrapper (.NET Wrapper for SugarCRM SOAP API). Source now available on GitHub!
    | GoldMine to SugarCRM Express Conversion. Latest: 1.0.1.7 (Nov. 3, 2009)
    | CRM SkyDialer (Skype Integration). Latest: 1.0.2 (Feb. 17, 2010)
    | Round Robin Leads Assignment
    | Phone Number Formatter
    | CaseTwit (Twitter Integration)
    ______________________________________________

  8. #8
    salvinitin24 is offline Junior Member
    Join Date
    Nov 2010
    Posts
    5

    Default Re: making billing address required

    Hi,

    I know it is March 2011 and I am too late for this reply but I cant help it because I started using sugar 5 months back.

    Well, I am also using v 5.2.0j CE and I was able to make address fields required. SMARTY template at \include\SugarFields\Fields\Address\en_us.EditView .tpl explains how to show required symbol. We have to use 'required' => array('billing_address_street','billing_address_ci ty','billing_address_state','billing_address_posta lcode'),
    instead of just 'required' => true

    Here is what I did.
    1) edit (copy & paste modules\Accounts\metadata\editviewdefs.php if you don't have it) at custom\modules\Accounts\metadata\editviewdefs.php to
    PHP Code:
    'lbl_address_information' => 
          array (
            
    => 
            array (
              
    => 
              array (
                
    'name' => 'billing_address_street',
                
    'hideLabel' => true,
                
    'type' => 'address',
                
    'displayParams' => 
                array (
                  
    'required' => array('billing_address_street','billing_address_city','billing_address_state','billing_address_postalcode'),
                  
    'key' => 'billing',
                  
    'rows' => 2,
                  
    'cols' => 30,
                  
    'maxlength' => 150,
                ),
                
    'label' => 'LBL_BILLING_ADDRESS_STREET',
              ), 
    then do quick repair and rebuild.

    I hope this helps someone.

    Thanks,
    Nitin
    Last edited by salvinitin24; 2011-03-02 at 06:42 PM.

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: 2009-09-10, 09:07 AM
  2. Replies: 7
    Last Post: 2009-03-09, 03:46 PM
  3. Replies: 2
    Last Post: 2008-08-23, 03:09 PM
  4. Making required filed not required?
    By miavfw in forum General Discussion
    Replies: 8
    Last Post: 2008-04-11, 09:17 PM
  5. Replies: 3
    Last Post: 2008-03-05, 01:34 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
  •