Where are sales stages stored?

Banging my head against the wall. In Drop Down Editor, I replaced the defalt sales stages with my three new ones (Open, Won, Lost).
And I’ve made the changes to these files:

custom/modules/Opportunities/dashlets/MyOpportunitiesDashlet/MyOpportunitiesDashlet.data.php
custom/modules/opportunities/metadata/SearchFields.php

and just to be sure in these files too.
modules/Opportunities/dashlets/MyOpportunitiesDashlet/MyOpportunitiesDashlet.data.php
modules/opportunities/metadata/SearchFields.php

My opportunities are not showing up. I turned on database logging and the query shows it’s still looking for the default stages - Prospecting, Qualification… etc.

I wrote a program to check all 15,000 files for the words Prospecting and Qualification - nothing found. I tried deleting cache folders, browser caches, no luck. I dumped the database to a text file and searched for those words - not found.

Where in the world is the application still pulling Prospecting, Qualification… from?

Forgot to mention - running a newly installed version 7.10.4.
Thanks for any help!

This is what I get for “Prospecting”

/var/www/html/modules/Charts/Dashlets/CampaignROIChartDashlet/CampaignROIChartDashlet.php:238:        $opp_query .= " and sales_stage='Prospecting'";

/var/www/html/modules/Campaigns/Charts.php:223:            $opp_query .= " and sales_stage='Prospecting'";
/var/www/html/modules/Campaigns/Charts.php:374:                 $opp_query .= " and sales_stage='Prospecting'";

/var/www/html/modules/Opportunities/Dashlets/MyOpportunitiesDashlet/MyOpportunitiesDashlet.data.php:49:                                                                    array('Prospecting', 'Qualification', 'Needs Analysis', 'Value Proposition', 'Id. Decision Makers', 'Perception Analysis', 'Proposal/Price Quote', 'Negotiation/Review')),

/var/www/html/include/language/en_us.lang.php:252:    'sales_stage_default_key' => 'Prospecting',
/var/www/html/include/language/en_us.lang.php:254:        'Prospecting' => 'Prospecting',
/var/www/html/include/language/en_us.lang.php:267:            'Prospecting' => '10',

Note that I smell trouble right there: there are hard-coded references to “Prospecting” in queries…

And for “Qualification”:


/var/www/html/modules/Opportunities/Dashlets/MyOpportunitiesDashlet/MyOpportunitiesDashlet.data.php:49:                                                                    array('Prospecting', 'Qualification', 'Needs Analysis', 'Value Proposition', 'Id. Decision Makers', 'Perception Analysis', 'Proposal/Price Quote', 'Negotiation/Review')),

/var/www/html/include/language/en_us.lang.php:255:        'Qualification' => 'Qualification',
/var/www/html/include/language/en_us.lang.php:268:            'Qualification' => '20',

If you edit the dropdown in Studio, you will probably see more files with these values getting written.

Maybe if you can work with the existing Sales Stages, even if you use just 3 of them, and try to hide the rest, that might make it easier.

1 Like

In case anyone has the same problem I did - I could not not figure out where SuiteCRM was pulling the original sales_stages from such as Prospecting, Qualification, Needs Analysis, etc., even after I had configured the app for new sale stages. I found that the old stages were Base64 encoded in the contents column of the user_preferences table, category “Home” for me. Here’s a portion of the decoded values stored in the database table:

a:2:{s:8:"dashlets";a:8:{s:36:"8e110960-286f-c1b2-06aa-5af0f23f06ed";a:5:{s:9:"className";s:17:"MyMeetingsDashlet";s:6:"module";s:8:"Meetings";s:11:"forceColumn";i:0;s:12:"fileLocation";s:65:"modules/Meetings/Dashlets/MyMeetingsDashlet/MyMeetingsDashlet.php";s:7:"options";a:0:{}}s:36:"95710f40-6c34-e61c-25ae-5af0f2258b69";a:5:{s:9:"className";s:22:"MyOpportunitiesDashlet";s:6:"module";s:13:"Opportunities";s:11:"forceColumn";i:0;s:12:"fileLocation";s:80:"modules/Opportunities/Dashlets/MyOpportunitiesDashlet/MyOpportunitiesDashlet.php";s:7:"options";a:6:{s:7:"filters";a:2:{s:12:"date_entered";a:0:{}s:11:"sales_stage";a:8:{i:0;s:11:[b]"[color=#ff0000]Prospecting";i:1;s:13:"Qualification";i:2;s:14:"Needs Analysis";i:3;s:17:"Value Proposition";i:4;s:19:"Id. Decision Makers";i:5;s:19:"Perception Analysis";i:6;s:20:"Proposal/Price Quote";i:7;s:18:"Negotiation/Review[/color]"[/b];}}s:5:"title";s:25:"My Top Open Opportunities";s:11:"myItemsOnly";s:4:"true";s:11:"displayRows";s:2:"10";s:14:"displayColumns";a:4:{i:0;s:4:"name";i:1;s:12:"account_name";i:2;s:15:"amount_usdollar";i:3;s:11:"date_closed";}s:11:"autoRefresh";s:2:"-1";}}s:36:"181f6304-65d6-c161-67c8-5af0f620cf90";a:4:{s:9:"className";s:13:"iFrameDashlet";s:6:"module";s:4:"Home";s:7:"options";a:4:{s:5:"title";s:14:"Account Lookup";s:3:"url";s:78:"http://localhost/php/suitecrm-account-lookup.php";s:6:"height";i:400;s:11:"autoRefresh";s:2:"-1";}s:12:"fileLocation";s:53:"modules/Home/Dashlets/iFrameDashlet/iFrameDashlet.php";}s:36:"7dfb8a97-2500-440a-ee6d-5af0f630449b";a:5:{s:9:"className";s:17:"MyAccountsDashlet";s:6:"module";s:8:"Accounts";s:7:"options";a:6:{s:7:"filters";a:1:{s:12:"date_entered";a:0:{}}s:5:"title";s:11:"My Accounts";s:11:"myItemsOnly";s:4:"true";s:11:"displayRows";s:2:"10";s:14:"displayColumns";a:5:
1 Like