Is there any way to join two tables like we join in MySQL like inner join , outer join etc
I want data from 2 tables on foreign key basis
Is there any way to join two tables like we join in MySQL like inner join , outer join etc
I want data from 2 tables on foreign key basis
SugarQuery offers handy wrappers to join across module, using the "link fields" to automatically relate two modules's SQL tables. You can read more about it here: https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_10.1/Data_Framework/Database/SugarQuery/#Relationships
Restrain yourself from using direct SQL queries. While they might be "quicker" to put together (if you are not familiar with SugarQuery), it opens your solution up to problems (eg: SQL injection, portability across databases, missing a relevant parameter on the query to name a few)
--
Enrico Simonetti
Sugar veteran (from 2007)
Feel free to reach out for consulting regarding:
All active SugarCRM certifications
Actively working remotely with customers based in APAC and in the United States
from where i download sugarQuery?
Rana Awais, your original question was about joining MySQL tables, so that's why I pointed you towards SugarQuery. Based on the question, I thought you wanted to build a custom api or functionality.
SugarQuery is included on Sugar's codebase.
There are many ways to achieve what you want to do. One example can be found here: https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_10.1/Cookbook/Web_Services/REST_API/PHP/How_to_Fetch_Related_Records/
You could also bulk apis together so that you limit the number of http requests you make.
If you open your instance's /rest/v10/help url, you will get a help page on how to use our api as well.
--
Enrico Simonetti
Sugar veteran (from 2007)
Feel free to reach out for consulting regarding:
All active SugarCRM certifications
Actively working remotely with customers based in APAC and in the United States
Enrico Simonetti basically my question is how i can join 2 modules like in MYSQL have
I want data from 2 modules in single Query
Basically what i am doing is
i am fetching records from "RELIC_Reseller_Quotes" module having reseller_id in it.
let suppose i got 30 records
after that i have to make a loop for these 30 records to get reseller name based on reseller_id from another module which is "Reseller", which take too much time
so i want to do in single query by using joins or any other method
Enrico Simonetti got the point?
please give me solution for that
thanks
I would do that with 2 api calls
--
Enrico Simonetti
Sugar veteran (from 2007)
Feel free to reach out for consulting regarding:
All active SugarCRM certifications
Actively working remotely with customers based in APAC and in the United States
Enrico Simonettithat "customer" is the module name?
but that is the same thing which i am doing
i also do the same
get 30 records and then have a loop on reseller which is additional query
Enrico Simonetti leave everything
can you please tell me from where i can download sugarQuery.php file
Harald Kuske
Principal Solution Architect – Professional Services, EMEA
hkuske@sugarcrm.com
SugarCRM Deutschland GmbH
Harald Kuske
in first line write "SugarQuery, located in ./include/SugarQuery/SugarQuery.php,"
where that file is ?
that sugarQuery.php file?
Harald Kuske from where i download it?
Harald Kuske from where i download it?
It is part of your own sugar installation which can be downloaded in your customer portal.
Harald Kuske
Principal Solution Architect – Professional Services, EMEA
hkuske@sugarcrm.com
SugarCRM Deutschland GmbH
Harald Kuske i have project on my local but didn't find any file in that specified path
Harald Kuske
Basically what i am doing is
i am fetching records from "RELIC_Reseller_Quotes" module having reseller_id in it.
let suppose i got 30 records
after that i have to make a loop for these 30 records to get reseller name based on reseller_id from another module which is "Reseller", which take too much time
so i want to do in single query by using joins or any other method
I want to do this
v11
v11
Which Version do you use?
Harald Kuske
Principal Solution Architect – Professional Services, EMEA
hkuske@sugarcrm.com
SugarCRM Deutschland GmbH
In version 10.1.0 you find that file in ...\include\SugarQuery\SugarQuery.php, which version is shown when you open the about screen in Sugar?
Harald Kuske
Principal Solution Architect – Professional Services, EMEA
hkuske@sugarcrm.com
SugarCRM Deutschland GmbH
can you please send me your sugarQury.php file
i will place it in my local and do my work on local
Sorry, that's not possible as the code is under license restrictions, please look to your code, which version is shown when you open the about screen in Sugar?
Harald Kuske
Principal Solution Architect – Professional Services, EMEA
hkuske@sugarcrm.com
SugarCRM Deutschland GmbH