Results 1 to 5 of 5

Thread: How to add a Custom Button to the Accounts listview

  1. #1
    chrislynch8's Avatar
    chrislynch8 is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Cork, Ireland
    Posts
    747

    Default How to add a Custom Button to the Accounts listview

    Hi,

    I'm on Sugar version 5.2k Pro. How can one add a new custom button to the listview of Accounts.

    Rgds
    Chris
    Linkedin Profile:Chris Lynch

    FDC IT Solutions
    FDC House
    Wellington Road
    Cork
    Ireland

  2. #2
    agcopley is offline Sugar Community Member
    Join Date
    Nov 2007
    Location
    Santiago, Chile
    Posts
    204

    Default Re: How to add a Custom Button to the Accounts listview

    Quote Originally Posted by chrislynch8 View Post
    Hi,

    I'm on Sugar version 5.2k Pro. How can one add a new custom button to the listview of Accounts.

    Rgds
    Chris
    Do a search in the forum on 'add custom button' would be my first port of call.

    Rgds

    Oops! I read editview! Thanks to andopes for putting me straight.
    Last edited by agcopley; 2010-02-24 at 09:52 PM. Reason: Error

  3. #3
    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: How to add a Custom Button to the Accounts listview

    You need to do the following:

    create a custom view.list.php for Accounts;
    implement the method preDisplay() containing something like that:

    PHP Code:
         function preDisplay(){
                require_once(
    'custom/modules/Accounts/ListViewAccounts.php');
             
    $this->lv = new ListViewAccounts();
         } 
    create the script custom/modules/Accounts/ListViewAccounts.php containing the class ListViewAccounts which extends ListViewSmarty.
    implement inside this class the method buldExportLink containing something like that:

    PHP Code:
        function buildExportLink($id 'export_link')  {
                    
    $script parent::buildExportLink($id);
            
    $script.= // the code for custom button

            
    return $script;
        } 
    Regards
    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.

  4. #4
    chrislynch8's Avatar
    chrislynch8 is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Cork, Ireland
    Posts
    747

    Default Re: How to add a Custom Button to the Accounts listview

    Hi André

    Thanks for that - what exactly is the $script ment to be. Is it javascript to create a button, is it php code?

    Rgds
    Chris
    Linkedin Profile:Chris Lynch

    FDC IT Solutions
    FDC House
    Wellington Road
    Cork
    Ireland

  5. #5
    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: How to add a Custom Button to the Accounts listview

    It is a php script.
    Take a look into function buildExportLink at include/ListView/ListViewDisplay.php

    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.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. HOWTO: Add custom button in ListView
    By kenneth.thorman in forum Developer Help
    Replies: 10
    Last Post: 2010-12-08, 07:35 PM
  2. creating custom button on listview
    By blqt in forum Help
    Replies: 6
    Last Post: 2010-11-30, 07:34 AM
  3. Create custom button - INSIDE of row of ListView
    By dantrainor in forum Developer Help
    Replies: 1
    Last Post: 2009-08-26, 08:01 AM
  4. Custom ListView button calls action
    By ReginaRoder in forum Developer Help
    Replies: 3
    Last Post: 2009-08-18, 04:53 AM
  5. Adding custom button on listview
    By Qamrun in forum Developer Help
    Replies: 2
    Last Post: 2009-07-09, 06: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
  •