Join 2 tables

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

Parents Reply
  • From what I understand from the conversation, looks like  is only having API access to Sugar, not the codebase itself, is that right Rana?

    The SugarQuery.php that Harald and Enrico are talking about - is part of the sugar code base, so if you need an API-only solution, sending the file to you will not help, because you won't be able to run it.

    The only solution I see here is the one Enrico suggested - using two API calls.

    1.  Get all your 30 records first, then group all the IDs - This is one API call.

    2. Instead of iterating the 30 records one by one and calling Sugar 30 times, use one API call with "in()" criteria - this will only make one API call. 

    Use the link that Enrico suggested to know how to make "$in" api calls:

    POST {{rest_url}}/Reseller/filter

    {
    "filter": [
    {
    "id": {
    "$in": [
    "id1",
    "id2",...
    "id30"
    ]
    }
    }
    ]
    }

    So ultimately your API calls will be reduced from 31 to just two, which will resolve your slowness problems.

Children