Results 1 to 4 of 4

Thread: Display Account in the Bugs module

  1. #1
    tejas is offline Junior Member
    Join Date
    Nov 2008
    Posts
    2

    Question Display Account in the Bugs module

    Hi Guys,
    I am new to sugar development.
    Looking at the database I can see that there is a relationship between accounts and bugs.
    I would like to diplay and select the account field (like the Assigned to field) on the bugs module.
    Can any one please help me do this??

    Thanks in advance


    Tejas

  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: Display Account in the Bugs module

    Hi Tejas

    You need to:
    1. create the account_id and account_name into extended vardefs of Bugs as non-db fields:
    custom/Extension/modules/Bugs/Ext/Vardefs/vardefs.ext.php

    PHP Code:
    $dictionary['Bug']['fields']['account_id'] = array(
        
    'name' => 'account_id',
        
    'id_name' => 'account_id',
        
    'vname' => 'LBL_ACCOUNT_ID',
        
    'type' => 'relate',
        
    'table' => 'accounts',
        
    'dbType' => 'id',
        
    'source' => 'non-db',
    );
    $dictionary['Bug']['fields']['account_name'] = array(
        
    'name' => 'account_name',
        
    'vname' => 'LBL_ACCOUNT_NAME',
        
    'type' => 'relate',
        
    'reportable' => false,
        
    'source' => 'non-db',
        
    'table' => 'accounts',
        
    'id_name' => 'account_id',
        
    'module' => 'Users',
    ); 

    2. Go to Admin -> Repair -> Rebuild Extension
    3. Add the account_name field into DetailView/EditView through Studio
    4. Create a logic_hook before_save for Bugs to add the account_id into relationship table it it does not exist.
    5. Create a logic_hook after_retrieve for Bugs to display the account_name into layout.

    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.

  3. #3
    tejas is offline Junior Member
    Join Date
    Nov 2008
    Posts
    2

    Default Re: Display Account in the Bugs module

    Hi André,
    Thanks for the prompt reply.
    I have got up point three.

    However can you please provide me with more information with the last two steps 4 & 5.
    Where and how do i create a logic hook as described in steps 4 and 5?

    4. Create a logic_hook before_save for Bugs to add the account_id into relationship table it it does not exist.
    5. Create a logic_hook after_retrieve for Bugs to display the account_name into layout.[/B]

    Thanks again.

  4. #4
    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: Display Account in the Bugs module

    Hi Tejas

    Take a look at this thread: http://www.sugarcrm.com/forums/showt...ght=logic_hook

    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. Module Builder
    By Olavo in forum Downloads
    Replies: 418
    Last Post: 2009-02-26, 06:36 AM
  2. Replies: 1
    Last Post: 2006-12-07, 09:20 PM
  3. Replies: 0
    Last Post: 2006-12-07, 09:10 PM
  4. how to assign bugs to account
    By roysterphil in forum Help
    Replies: 3
    Last Post: 2006-11-29, 04:30 PM
  5. Replies: 1
    Last Post: 2006-09-11, 03: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
  •