Results 1 to 7 of 7

Thread: Make Opportunity Name a dropdown

  1. #1
    sgilleland is offline Senior Member
    Join Date
    Jun 2009
    Posts
    45

    Default Make Opportunity Name a dropdown

    How can I make the field "Opportunity Name" a drop down. We have limited opportunities and would like the consistant.

  2. #2
    Angel's Avatar
    Angel is offline Sugar Community Member
    Join Date
    Jul 2005
    Location
    Los Angeles
    Posts
    4,813

    Default Re: Make Opportunity Name a dropdown

    Try this:

    1. Define your drop down list via the Drop Down editor in the Admin control panel. For our example, we'll assume you've named it: opp_name_dom

    2. Create a PHP file name vardefs.ext.php and put the following code in it:

    <?php
    $dictionary['Opportunity']['fields']['name']['type']='enum';
    $dictionary['Opportunity']['fields']['name']['options']='opp_name_dom';
    ?>

    3. Save the new PHP file to <sugar>/custom/Extension/modules/Opportunities/Ext/Vardefs. If the directory structure does not exist, create it manually, making sure that the web user has permissions to it.

    4. Do a Quick Rebuild & Repair on the Opportunities via the Repair option in the Admin control panel.
    Regards,

    Angel Magaña
    Co-Author: Implementing SugarCRM 5.x (Packt Publishing -- Sept. 2010)
    Blog: http://cheleguanaco.blogspot.com.
    Twitter: @cheleguanaco.

    ________
    | Projects: |_____________________________________
    |
    | CandyWrapper (.NET Wrapper for SugarCRM SOAP API). Source now available on GitHub!
    | GoldMine to SugarCRM Express Conversion. Latest: 1.0.1.7 (Nov. 3, 2009)
    | CRM SkyDialer (Skype Integration). Latest: 1.0.2 (Feb. 17, 2010)
    | Round Robin Leads Assignment
    | Phone Number Formatter
    | CaseTwit (Twitter Integration)
    ______________________________________________

  3. #3
    sgilleland is offline Senior Member
    Join Date
    Jun 2009
    Posts
    45

    Default Re: Make Opportunity Name a dropdown

    That worked perfect! Thank you VERY much.


    Thanks,
    Skip

  4. #4
    sgilleland is offline Senior Member
    Join Date
    Jun 2009
    Posts
    45

    Default Re: Make Opportunity Name a dropdown

    that worked except for when you convert a lead and use the checkbox for opportunity......the dropdown doesn't show up there......any ideas?

  5. #5
    Angel's Avatar
    Angel is offline Sugar Community Member
    Join Date
    Jul 2005
    Location
    Los Angeles
    Posts
    4,813

    Default Re: Make Opportunity Name a dropdown

    That makes sense. Two different templates are used for the two various actions, hence the difference you notice.

    I'll take a look at it in a few and post later, but as far as I know, there is no upgrade safe way of modifying that template.

    [EDIT]

    Looks like you'll want to make the edit in:

    function getWideFormBody() in the <sugar>/modules/Opportunities/OpportunityFormBase.php file.

    Just want to stress that as far as I know, there is no way of doing this in an upgrade-safe manner.
    Last edited by Angel; 2009-09-30 at 12:23 AM.
    Regards,

    Angel Magaña
    Co-Author: Implementing SugarCRM 5.x (Packt Publishing -- Sept. 2010)
    Blog: http://cheleguanaco.blogspot.com.
    Twitter: @cheleguanaco.

    ________
    | Projects: |_____________________________________
    |
    | CandyWrapper (.NET Wrapper for SugarCRM SOAP API). Source now available on GitHub!
    | GoldMine to SugarCRM Express Conversion. Latest: 1.0.1.7 (Nov. 3, 2009)
    | CRM SkyDialer (Skype Integration). Latest: 1.0.2 (Feb. 17, 2010)
    | Round Robin Leads Assignment
    | Phone Number Formatter
    | CaseTwit (Twitter Integration)
    ______________________________________________

  6. #6
    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: Make Opportunity Name a dropdown

    Quote Originally Posted by sgilleland View Post
    that worked except for when you convert a lead and use the checkbox for opportunity......the dropdown doesn't show up there......any ideas?
    You need to modify the function getWideFormBody on modules/Opportunities/OpportunityFormBase.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.

  7. #7
    rebeccah is offline Junior Member
    Join Date
    May 2010
    Posts
    1

    Default Re: Make Opportunity Name a dropdown

    Hi, I'm trying to change the dropdown for opportunity names as well. I was able to create the dropdown and change the code in OpportunityFormBase.php in order to have the dropdown show up when converting a lead to an opportunity. The problem I'm having now is that when it saves, it doesn't save the opportunity name I chose from the dropdown. I get this message when I save the form:

    - Used an existing contact - Sample COMPANY
    - Used an existing account - Sample Company
    - Created a new opportunity -

    As you can see, opportunity is blank. So I have to go into that opportunity and choose a name and save it to get it to show up properly. I've been through OpportunityFormBase.php to see where I need to make changes, but I only know some basic PHP so I'm a bit lost. Any help would be much appreciated! Thanks.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 18
    Last Post: 2010-05-05, 09:21 AM
  2. Make Opportunity mandatory on Convert Lead.
    By hensor in forum Developer Help
    Replies: 1
    Last Post: 2009-07-14, 02:31 AM
  3. How can I make dropdown editable?
    By pallavic in forum Developer Help
    Replies: 1
    Last Post: 2009-03-02, 06:56 PM
  4. Make country dropdown sugar 5.2 a PRO
    By imran123 in forum Developer Help
    Replies: 2
    Last Post: 2009-02-24, 02:04 PM
  5. Replies: 2
    Last Post: 2008-07-24, 08:07 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
  •