Good day,
My goal: To search the accounts module for zip codes to get the account ids to match in the relations table (accounts_opportunities) to get the associated opportunity_ids ...
I am looking for some assistance / review / feedback.
I have updated the searchdefs.php and the SearchFields.php in the custom/modules/Opportunities/metadata/ dir.
A rebuild has the field available on the panel.
An entry in the field and a search results in no action. I am not seeing any entries in logs or errors (at DEBG level) when I make a search in the accounts.billing_address_postalcode field in the Advanced Search form. The web server spins when an entry and submit is made the count goes to 0 then back to a full result set.
I think the main piece is the SQL, I am using innerjoin (tried subquery earlier from other reading I had done -- no joy there). The INNER Join SQL is below. I have run in the SQL in a db command prompt and get expected results.
I can provide more information and am asking if you can provide more feedback.
In advance I thank you for your time. Let me know if you have any thoughts or pointers. I will continue to research and test but at this point seem to be at a stop point.
'innerjoin' => 'INNER JOIN accounts_opportunities on accounts_opportunities.opportunity_id=opportunitie s.id INNER JOIN accounts on accounts.id=accounts_opportunities.account_id WHERE accounts.deleted=0 AND billing_address_postalcode LIKE',
Here is an example of a complete SQL query that provides accurate results:
SELECT opportunities.id from opportunities opportunities INNER JOIN accounts_opportunities on accounts_opportunities.opportunity_id=opportunitie s.id INNER JOIN accounts on
accounts.id=accounts_opportunities.account_id WHERE accounts.deleted=0
AND billing_address_postalcode LIKE '92%';
Few related items I found while digging into this:
SugarCRM Developer Blog » Blog Archive » HOWTO: Add a search field that searches another module
Lairds Computer Services > Blog - SugarCRM Cross Module Search Fields


LinkBack URL
About LinkBacks



Reply With Quote

Bookmarks