Results 1 to 4 of 4

Thread: add Email1 field in sidequickcreate view

  1. #1
    mikrob35 is offline Senior Member
    Join Date
    Sep 2008
    Posts
    22

    Default add Email1 field in sidequickcreate view

    Hi all,

    In Sugar5.1, my Accounts module uses a email1 field (so that the email adress is automatically chosen when I click on "compose E-mail"...).

    This is the only field that I can't add to the SideQuickCreate view trough the \modules\Accounts\metadata\sidecreateviewdefs.php file.

    In this file, I tried to add :

    Code:
     array (
                'name' => 'email1',
                'label' => 'email1',
              ),
    as I use successfully in \custom\modules\Accounts\metadata\editviewdefs.php but the field won't appear (just its name)

    I aslo tried to use the different e-mail related vars present in \modules\Accounts\vardefs.php ('emails' , 'email_addresses', 'email_addresses_primary', 'account_emails') but without a result (the 2 first show a http type field and the 3rd nothing)

    I guess it is because email1 is a "native" field (ie not a custom one) but the \include\SugarObjects\templates\company\vardefs.ph p file where it is defined did not bring me to a solution...

    I also thought of defining an extended vardef, but I can't think of an extra param which could make this email1 field appear in the sidequickrectae view.

    Would anybody have a solution or idea to solve this issue?

    Big thanks in advance.

  2. #2
    mikrob35 is offline Senior Member
    Join Date
    Sep 2008
    Posts
    22

    Default Re: add Email1 field in sidequickcreate view

    OK. I found the solution to this problem.

    I just copied this code extract from Contacts\metadata\sidecreateviewdefs.php to Accounts\metadata\sidecreateviewdefs.php

    Code:
    array (
         array('name'=>'email1', 'customCode'=>'<input type="text" name="emailAddress0" size=20><input type="hidden" name="emailAddressPrimaryFlag" value="emailAddress0"><input type="hidden" name="useEmailWidget" value="true"><script language="Javascript">addToValidate("form_SideQuickCreate_Contacts", "emailAddress0", "email", false, SUGAR.language.get("app_strings", "LBL_EMAIL_ADDRESS_BOOK_EMAIL_ADDR"));</script>'),
        ),
    Strangely enough, this trick doesn't work for the ListView : I can't display the email adresses when I copy this code extract from \modules\Contacts\metadata\listviewdefs.php to \custom\modules\Accounts\metadata\listviewdefs.php :
    Code:
    	'EMAIL1' => array( 		'width' => '15%',  		'label' => 'LBL_LIST_EMAIL_ADDRESS', 		'sortable' => false,  		'customCode' => '{$EMAIL1_LINK}{$EMAIL1}</a>',         'default' => true, 		),
    I anybody finds a way to display clickable email adresses in a Accounts LIstView page, I would be greatly interested.

    Cheers.

  3. #3
    ddaavvee is offline Sugar Community Member
    Join Date
    Jan 2008
    Posts
    10

    Default Re: add Email1 field in sidequickcreate view

    In anwer to last question, "anybody finds a way to display clickable email adresses in a Accounts LIstView page"

    Try go to listviewdefs.php for the module to fix, in the 'EMAIL1 => (array...' change 'customCode' => line to like this below:


    'EMAIL1' =>
    array (
    'width' => '15%',
    'label' => 'LBL_EMAIL_ADDRESS',
    'sortable' => false,
    'link' => true,
    'customCode' => '<a href="mailto:{$EMAIL1}">{$EMAIL1}</a>',
    'default' => true,
    ),


    (note: you might need to change the listviewdefs.php in /custom/modules/[module to fix]/metadata/listviewdefs.php instead if you've customized the module previously with studio)

  4. #4
    Join Date
    Sep 2010
    Posts
    6

    Default Re: add Email1 field in sidequickcreate view

    THANKS! That was really helpful!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Add user related custom field
    By kuske in forum Developer Help
    Replies: 14
    Last Post: 2011-02-08, 06:17 AM
  2. problem when using SOAP query on email1 field
    By skaag in forum Developer Help
    Replies: 5
    Last Post: 2008-08-14, 02:26 PM
  3. Replies: 0
    Last Post: 2007-08-09, 06:34 PM
  4. Replies: 0
    Last Post: 2006-10-01, 02:13 AM
  5. How to add an existing field to a list view in field layout?
    By Lawrence in forum General Discussion
    Replies: 1
    Last Post: 2005-04-22, 01:38 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
  •