Results 1 to 4 of 4

Thread: Override Contact class

  1. #1
    maxime.lambert is offline Senior Member
    Join Date
    Apr 2009
    Posts
    24

    Question Override Contact class

    Hi all,

    Can I override Contact class by creating a new file Contact.php in custom/modules/Contacts/ ?

  2. #2
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Override Contact class

    Yes, you need to create a custom controller for Contacts module:

    PHP Code:
    <?PHP
    require_once('include/MVC/Controller/SugarController.php');
    require_once(
    'custom/modules/Opportunities/OpportunityInListView.php');

    class 
    OpportunitiesController extends SugarController {
        function 
    action_listview(){
            
    $this->view 'list';
            
    $this->bean = new OpportunityInListView();
        }
    }
    ?>
    Important note: the new class must extends the default one

    Cheers
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  3. #3
    maxime.lambert is offline Senior Member
    Join Date
    Apr 2009
    Posts
    24

    Thumbs up Re: Override Contact class

    Oh... of course...
    Thanks a lot !!

  4. #4
    TheLetterM's Avatar
    TheLetterM is offline Senior Member
    Join Date
    Mar 2009
    Posts
    26

    Default Re: Override Contact class

    Sorry, but I dont quite understand.

    I would like to do something similar, overriding the Account.php bean to override the functions retrieve() and get_list_view_array() in an upgrade-safe manner.

    I dont understand how to use andy's code to do this.

    More explanation or another suggestion on how to do this?

    Sugar 5.2d.

    Thanks,
    M.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to override editviewdef
    By gopalkalasa in forum Developer Help
    Replies: 9
    Last Post: 2011-07-22, 01:58 PM
  2. HOW TO: Override a Template
    By luisfdo in forum Developer Tutorials
    Replies: 10
    Last Post: 2010-12-01, 12:21 PM
  3. I want to override SugarObjects
    By SugarDev.net in forum Developer Help
    Replies: 7
    Last Post: 2010-11-23, 02:45 AM
  4. listview override help
    By marketadvantage in forum Developer Help
    Replies: 1
    Last Post: 2008-08-22, 07:31 PM
  5. Override files
    By vsaranya in forum Developer Help
    Replies: 0
    Last Post: 2008-01-24, 06:26 AM

Tags for this Thread

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
  •