Pop up view opportunity missing create button

when I call the opportunity pip-up view (for example when composing an e-mail and trying to relate that mail to an opportunity, I see that in the pop-up the “create” option is missing. Only search.

In other pop up, like contacts for example, there is available the button “create”.

I have studied through studio, but I didn’t find any answers.

If you have a main file custom/modules/Opportunities/metadata/popupdefs.php, if it does not exist then in file modules/Opportunities/metadata/popupdefs.php add the following line:

'create' => array (
         'formBase' => 'OpportunityFormBase.php',
         'formBaseClass' => 'OpportunityFormBase',
         'getFormBodyParams' =>
             array (
                 0 => '',
                 1 => '',
                 2 => 'OpportunitySave',
         'createButton' => 'LBL_NEW_FORM_TITLE',

I did it, but never happened, exactly the same…

Show me please your custom / modules / Opportunities / metadata / popupdefs.php
You make quick Repiear after change this file?

Yes I did the quick repair. Not the first time, but now that you mentioned it I did it.

The same.

I attach here the popupdefs.php file.

if (!defined('sugarEntry') || !sugarEntry) {
    die('Not A Valid Entry Point');

global $mod_strings;

$popupMeta = array('moduleMain' => 'Opportunity',
                        'varName' => 'OPPORTUNITY',
                        'orderBy' => 'name',
	‘create’ => array (
		‘formBase’ => ‘OpportunityFormBase.php’,
		‘formBaseClass’ => ‘OpportunityFormBase’,
		‘getFormBodyParams’ =>
			array (
				0 => ‘’,
				1 => ‘’,
				2 => ‘OpportunitySave’,
		‘createButton’ => ‘LBL_NEW_FORM_TITLE’, 
                        'whereClauses' =>
                            array('name' => 'opportunities.name',
                                    'account_name' => 'accounts.name'),
                        'searchInputs' =>
                            array('name', 'account_name'),
                        'listviewdefs' => array(
                                            'NAME' => array(
                                                'width'   => '30',
                                                'label'   => 'LBL_LIST_OPPORTUNITY_NAME',
                                                'link'    => true,
                                                'default' => true),
                                            'ACCOUNT_NAME' => array(
                                                'width'   => '20',
                                                'label'   => 'LBL_LIST_ACCOUNT_NAME',
                                                'id'      => 'ACCOUNT_ID',
                                                'module'  => 'Accounts',
                                                'default' => true,
                                                'sortable'=> true,
                                                'ACLTag' => 'ACCOUNT'),
                                            'OPPORTUNITY_TYPE' => array(
                                                'width' => '15',
                                                'default' => true,
                                                'label' => 'LBL_TYPE'),
                                            'SALES_STAGE' => array(
                                                'width'   => '10',
                                                'label'   => 'LBL_LIST_SALES_STAGE',
                                                'default' => true),
                                            'ASSIGNED_USER_NAME' => array(
                                                'width' => '5',
                                                'label' => 'LBL_LIST_ASSIGNED_USER',
                                                'default' => true),
                        'searchdefs'   => array(
                                            array('name' => 'account_name', 'displayParams' => array('hideButtons'=>'true', 'size'=>30, 'class'=>'sqsEnabled sqsNoAutofill')),
                                            array('name' => 'assigned_user_id', 'type' => 'enum', 'label' => 'LBL_ASSIGNED_TO', 'function' => array('name' => 'get_user_array', 'params' => array(false))),

correct the quotation marks that are in my code

incorrect quotation marks are specified here. Your code editor underlines this with color.

Here in the forums, to add code (and make sure no quotes get changed!), and also to get nice syntax highlighting, use triple backquotes.


Thank you. In the next posts I will correct this oversight.

I don’t understand. I copied the code from your original post. Where is the error with quotation marks?

The Forums software changes 'quotes' into ‘quotes’ unless we use the proper code tags.

The earlier posts have been edited to use the proper code tags, so if you copy-paste now you should get the correct quotes in your code and solve the problem.

That’s fantastic. It works perfectly now. Thanks to all.