Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Removing Required Field

  1. #1
    Rjrobinson is offline Member
    Join Date
    Apr 2009
    Posts
    9

    Default Removing Required Field

    I'm trying to remove the requirement of a "last Name:" being entered on a new lead. I've modified the following files:

    editviewdefs:

    array (
    array('name'=>'last_name',
    'displayParams'=>array('required'=>false),

    Field_arrays:

    removed line of code requiring "last name" field.

    The red dot is gone but when I hit Save it still gives me an error.


    Thanks for the help.....

    RJ

  2. #2
    genius786's Avatar
    genius786 is offline Sugar Community Member
    Join Date
    Nov 2008
    Location
    Karachi, Pakistan
    Posts
    131

    Smile Re: Removing Required Field

    Hi,

    Why you want to change the required field tag from the last name if you want to change then create new custom last name and rename the last name with any other field. May be this will help you. Because last name is the field to retrieve data.


    Best regards,
    SARFARAZ AHMED KHAN
    Karachi, Pakistan
    skype: genius_crystal
    genius_crystal@hotmail.com
    92-314-2595624

  3. #3
    Rjrobinson is offline Member
    Join Date
    Apr 2009
    Posts
    9

    Default Re: Removing Required Field

    The business lists that I import don't have a last name, only a first.

    Thanks for the reply...

  4. #4
    mvngti is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    South Africa
    Posts
    510

    Default Re: Removing Required Field

    You have to modify the vardefs for the module to remove it for importing.

    copy modules/<module>/vardefs.php to custom/Extension/modules/<module>/Vardefs/extended.php and remove the required attribute from the field in the copy.

    Then rebuild extensions.

    M
    --


    Marnus van Niekerk

    There are only 10 types of people in the world
    those who can read binary and those who don't

    Modules:
    CE Teams - Upgrade safe teams module for Community Edition
    FieldACL - Field Level Access Control for Community Edition
    EditLogicHooks - Create and edit Logic Hooks from the Admin GUI
    FlexibleChartDashlet - Display any data in a Dashlet Chart
    DocumentThumbnails - Thumbnails for Documents module

    Many questions can be answered by reading the Developers Manual

  5. #5
    jsagar's Avatar
    jsagar is offline Sugar Community Member
    Join Date
    Mar 2008
    Location
    Ahmedabad,India
    Posts
    242

    Default Re: Removing Required Field

    hi,
    you can write like this in custom Vardefs

    $dictionary['Account']['fields']['last_name']['required'] = false;
    Best Regards
    ---------------------------------------
    Jaydeepsinh Sagar

  6. #6
    JanAcc is offline Member
    Join Date
    Oct 2008
    Posts
    10

    Default Re: Removing Required Field

    Hi,

    the field "date_closed" in the module opportunities is by default required (red asterisk).

    Where is this information stored?

    In the file modules/Opportunities/vardefs.php I found the following:
    PHP Code:
    'date_closed' =>
      array (
        
    'name' => 'date_closed',
        
    'vname' => 'LBL_DATE_CLOSED',
        
    'type' => 'date',
        
    'audited'=>true,
        
    'comment' => 'Expected or actual date the oppportunity will close',
        
    'importable' => 'required',
      ) 
    Regards
    JanAcc

  7. #7
    jsagar's Avatar
    jsagar is offline Sugar Community Member
    Join Date
    Mar 2008
    Location
    Ahmedabad,India
    Posts
    242

    Default Re: Removing Required Field

    hi,
    you have to write it in to the
    following directory
    custom/Extension/modules/<Module>/Ext/Vardefs/verdef.php

    if you don't have the directory you have to create it.
    then write the following code into it

    $dictionary['Account']['fields']['last_name']['required'] = false;

    here you have to write your module & field name..
    then rebuild the cache from admin panel.
    Best Regards
    ---------------------------------------
    Jaydeepsinh Sagar

  8. #8
    JanAcc is offline Member
    Join Date
    Oct 2008
    Posts
    10

    Default Re: Removing Required Field

    Thanks for your reply.

    Quote Originally Posted by jsagar View Post
    hi,
    then write the following code into it

    $dictionary['Account']['fields']['last_name']['required'] = false;
    Do I have to copy the file modules/<module>/vardefs.php to custom/Extension/modules/<Module>/Ext/Vardefs/verdef.php first?
    And THEN put the line
    PHP Code:
    $dictionary['Account']['fields']['last_name']['required'] = false
    into it?

    Sorry for the dumb questions but I am really confused right now. I have the feeling there are hundreds of ways to archieve this and everyone is talking of yet another.

    Regards
    JanAcc

  9. #9
    jsagar's Avatar
    jsagar is offline Sugar Community Member
    Join Date
    Mar 2008
    Location
    Ahmedabad,India
    Posts
    242

    Default Re: Removing Required Field

    hi,
    no you have to just put the line
    no need to copy whole file
    Best Regards
    ---------------------------------------
    Jaydeepsinh Sagar

  10. #10
    JanAcc is offline Member
    Join Date
    Oct 2008
    Posts
    10

    Default Re: Removing Required Field

    Ok, looks like I need help again...

    In my case I am trying to remove the required field date_closed in the Opportunity module.

    What I did:
    Adding ONLY the following line in custom/Extension/modules/Opportunities/Ext/Vardefs/vardefs.php
    $dictionary['Opportunities']['fields']['date_closed']['required'] = false;

    Clearing the cache by clicking in the admin section Repair->Clear Vardefs Data Cache

    Nevertheless field date_closed is still required...
    Any ideas?

    Regards
    Janek

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 13
    Last Post: 2010-12-03, 11:17 AM
  2. Removing Required Field
    By tuser13 in forum Help
    Replies: 11
    Last Post: 2008-06-05, 06:01 AM
  3. Replies: 0
    Last Post: 2008-03-20, 06:55 PM
  4. Replies: 4
    Last Post: 2007-08-24, 10:17 AM
  5. Replies: 7
    Last Post: 2007-07-13, 01:38 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
  •