Results 1 to 6 of 6

Thread: Create Button and Custom Modules

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

    Default Create Button and Custom Modules

    Hi,

    With all my Custom Modules I have create when I press create under an Account, it goes to the full form, editview. How can I make this happen for other Modules such as Contacts, so that when my users press create on a Contact under Account the quick create is skipped and it goes straight to the full form

    Rgds
    Chris
    Linkedin Profile:Chris Lynch

    FDC IT Solutions
    FDC House
    Wellington Road
    Cork
    Ireland

  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: Create Button and Custom Modules

    You need to create an extended layoutdefs for Accounts to override the Create button:
    custom/Extension/modules/Accounts/Ext/Layoutdefs/layoutdefs.ext.php
    PHP Code:
    <?PHP
    $layout_defs
    ['Accounts']['subpanel_setup']['contacts']['top_buttons'][0] = 'SubPanelTopCreateButton';
    ?>
    Go to Admin -> Repair -> Rebuild Extensions

    You also will need to customize the Contacts controller.php (function action_edtiview) to implement the same logic in the file include/generic/SugarWidgets/SugarWidgetSubPanelTopCreateAccountNameButton.php

    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
    chrislynch8's Avatar
    chrislynch8 is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Cork, Ireland
    Posts
    747

    Default Re: Create Button and Custom Modules

    Hi,

    When I extend the laoutdefs and rebuild the extensions none of my Subpanels appear under Accounts. I have made the modification as per your last post above, when I remove the mod again all my subpanels appear under Accounts after I rebuild the extensions.

    Rgds
    Chris

    *********************************UPDATE*********** ********************
    In the layoutdefs.ext.php if I remove the [0] and rebuild the Extensions all my Subpanels appear under Accounts but the Contacts subpanel has no buttons. What is the final [0] for, or where can I find documentation on it? I search the forums for layoutdefs.ext.php and the majoirty of examples where changes to Relationships or adding extra Subpanels, The Developer Guide is very useful either.
    Last edited by chrislynch8; 2009-08-26 at 10:44 AM.
    Linkedin Profile:Chris Lynch

    FDC IT Solutions
    FDC House
    Wellington Road
    Cork
    Ireland

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

    Default Re: Create Button and Custom Modules

    Hi, I have extended the layoutdefs for Accounts and for Contacts to go to the Full Form for Cases when Create is pressed in the subpanel of an Account or a Contact. I have also extended layoutdefs to remove the Create button for Account under Contacts and for Member Orgs under Accounts.

    I have also edited my config file to collapse the Subpanels.

    With the Subpanels collapsed I am unable to expand them for Member Orgs and Cases under Accounts but they work fine under Contacts.

    Is this correct, should the Extended Layoutdefs work with Subpanels set to collapse by Default

    Rgds
    Chris
    Linkedin Profile:Chris Lynch

    FDC IT Solutions
    FDC House
    Wellington Road
    Cork
    Ireland

  5. #5
    webnetin is offline Sugar Community Member
    Join Date
    Dec 2005
    Posts
    68

    Default Re: Create Button and Custom Modules

    Recently I had the same requirement - Clicking Create button for Opportunities from Accounts detailview opens the full form instead of Quick Create view.

    As usual I took lead from André 's response here

    It works with a small modification.
    PHP Code:
    <?PHP
    $layout_defs
    ['Accounts']['subpanel_setup']['opportunities']['top_buttons'][0]['widget_class'] = 'SubPanelTopCreateButton';
    ?>
    Note the 'widget_class' at end of parameter definition

    regards
    Deepa

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

    Default Re: Create Button and Custom Modules

    Hi Adding that 'widget_class' work perfectly for my Cases but when I have it for contacts and I press create I go to a blank page.

    Have you been able to get this to work with Contacts, I see you have ti with Opps

    Rgds
    Chris
    Linkedin Profile:Chris Lynch

    FDC IT Solutions
    FDC House
    Wellington Road
    Cork
    Ireland

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Can't create custom made modules
    By nscholten in forum Help
    Replies: 0
    Last Post: 2008-05-21, 07:44 PM
  2. How to create relation between two custom modules
    By sawan in forum Developer Help
    Replies: 3
    Last Post: 2008-03-03, 05:50 PM
  3. Replies: 5
    Last Post: 2008-03-02, 06:59 PM
  4. How to create advanced relationship in custom modules
    By leftdrive in forum Developer Help
    Replies: 3
    Last Post: 2008-02-20, 07:35 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
  •