Results 1 to 5 of 5

Thread: add contact: disable last name "required"?

  1. #1
    caxy is offline Sugar Community Member
    Join Date
    Dec 2007
    Posts
    16

    Question add contact: disable last name "required"?

    I am trying to figure out how to make it so that last name is not a required filed for creating a new contact. In the studio, it seems like you can choose which fields you want required but for last name I do not see an option to disable this.

    Does anyone know how to change this?

    See screen below for a picture of one of the areas that show Last name as required.



  2. #2
    JVWay is offline Sugar Community Member
    Join Date
    Sep 2007
    Location
    Corvallis, Oregon
    Posts
    452

    Default Re: add contact: disable last name "required"?

    Something has to be required. Last name is the only thing required in Contact. Did you want to add something else as required in place of last name? I supposed you could add a new field and make it required but the last name is probably a non-null value in the database and you'd have to change that. This would not be recommended and certainly not upgrade safe.
    Jerry Way
    Business Process Administrator

    Sugar 6.1.4 Professional
    (Testing 6.1.2)
    LAMP on Centos 5
    PHP 5
    MySQL 5
    Apache 2.2

  3. #3
    caxy is offline Sugar Community Member
    Join Date
    Dec 2007
    Posts
    16

    Default Re: add contact: disable last name "required"?

    Yeah I realize that it is not a good practice by any means but it is what the client asked for.


    Are you saying that this could be accomplished by simply altering the DB? Or will I need to modify something in the sugar code? (besides the actual template which shows the red * )

  4. #4
    JVWay is offline Sugar Community Member
    Join Date
    Sep 2007
    Location
    Corvallis, Oregon
    Posts
    452

    Default Re: add contact: disable last name "required"?

    While I'm not sure, I would bet that there is something in the code. Otherwise it would be depending on an error from SQL saying you can't insert a null value. It's probably a setting of 0 or 1. I would try making a custom field and marking it required. Then check out the effect in the custom module section of the code.
    Jerry Way
    Business Process Administrator

    Sugar 6.1.4 Professional
    (Testing 6.1.2)
    LAMP on Centos 5
    PHP 5
    MySQL 5
    Apache 2.2

  5. #5
    caxy is offline Sugar Community Member
    Join Date
    Dec 2007
    Posts
    16

    Default Re: add contact: disable last name "required"?

    As it turns out, I was looking in the wrong spot.

    For people looking to do this:

    You need to change the defs in sidecreateviewdefs.php in the meta folder for Contacts.

    PHP Code:
       array('name'=>'last_name',
                
    'displayParams'=>array('required'=>false'size'=>20),
          ), 
    Set required = false to remove the requirement, likewise, you could add required = true to other fields to make them required. Also, note * is automatically removed by doing this.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 0
    Last Post: 2008-02-13, 07:52 AM
  2. Add Select field button to Contact Name in Case.
    By sopik in forum Developer Help
    Replies: 1
    Last Post: 2007-10-08, 10:02 AM
  3. Replies: 5
    Last Post: 2007-04-26, 07:43 PM
  4. Replies: 1
    Last Post: 2006-09-27, 11:49 AM

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
  •