Results 1 to 3 of 3

Thread: Detail View Formatting of Phone Numbers

  1. #1
    Shad Guest

    Default Detail View Formatting of Phone Numbers

    Hello,

    I'd like to keep phone numbers for a module stored in the database with no characters. I'm good with this code written as a logic hook. The main reason for this is to make search uniform and easier.

    To make the number more readable I'd like to use some javascript to display it formatted (xxx) xxx-xxxx

    I've been following the blog post below but looks like the modifications are for the editviewdefs.

    Angel's Blog: SugarCRM Customization: Utilizing Custom JavaScript
    Added the javascript file to includes.
    'includes' =>
    array (
    0 =>
    array ('file' => 'modules/Accounts/Account.js',),
    1 =>
    array('file' => 'custom/include/javascript/phone_format.js',)
    ),


    Changed the field defs below.
    array (
    'name' => 'phone_office',
    'comment' => 'The office phone number',
    'label' => 'LBL_PHONE_OFFICE',
    'customCode' => '< id="phone_office" onload="fmt(this.value, this.id)" type="hidden" title="{$fields.phone_office.value}" value="{$fields.phone_office.value}">',
    ),

    I'm getting the text of the javascript file displayed at the top of the window and< id="phone_office" onload="fmt(this.value, this.id)" type="hidden" title="" value=""> displayed in the field.

    Any tips would be greatly appreciated.

    Thanks

  2. #2
    bickart68 is offline Sugar Community Member
    Join Date
    Apr 2008
    Posts
    179

    Default Re: Detail View Formatting of Phone Numbers

    We are releasing this functionality on Sugar Outfitters this week

  3. #3
    Shad Guest

    Default Re: Detail View Formatting of Phone Numbers

    Great, thanks for the heads up. Looking forward to it.

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: 2013-05-02, 08:33 AM
  2. creating custom phone fields (link on phone numbers)
    By anpeople in forum Developer Help
    Replies: 0
    Last Post: 2012-06-26, 09:22 AM
  3. Account phone number show in detail view
    By lucaspr in forum Help
    Replies: 2
    Last Post: 2010-03-12, 02:58 PM
  4. Replies: 2
    Last Post: 2009-10-14, 12:43 AM
  5. Phone numbers in Edit Call View
    By InstantHousecall in forum Help
    Replies: 1
    Last Post: 2009-10-10, 07:39 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
  •