Hello,
I’m new to the WmSalesforeAdapter.
Currently I have a business requirements which should extract data from multiple Saleasforce objects. Using CustomQuery we can get this, but I’m not familiar with SOQL so can you please help me with the custom query service with complex JOIN conditions.
Please google it and any SQL site can provide you the query syntax (make sure you have a better understanding on your source DB/tables that are scope in the project)
Salesforce.com imposes restrictions on the number of IDs that can be passed for a single call. Ensure that the number of IDs passed to a single Retrieve operation does not exceed the maximum limit. For more information, see the Force.com Web Services API Developer’s Guide.
Thanks Rankesh,
Actually I am able to get data from single object when I use Retrieve operation… however the current requirement is to extract data from 2 or more objects for that I’ve to use CustomQuery operation.
I’ve been trying to google and get the correct syntax for the custom query… however the challenge I’ve is, some of the object I’ve to extract are custom objects… and not completely clear on how to give the join condition.
Below is the Query I’m using and I’m getting below error… Can you please let me know what this error means
I’m trying to get data from Account object with CVR__c (Customer Visit Report) object.
Query:
SELECT Id, Name, (SELECT Id, Visit_Date__c from CVR__c WHERE LastModifiedDate >= LAST_N_DAYS:7) FROM Account
Error message:
com.wm.app.b2b.server.ServiceException: [ART.117.4002] Adapter Runtime (Adapter Service): Unable to invoke adapter service service:TestCustomSOQLwithSubQuery.
[ADA.505.1011] API Fault occurred while executing the call [CustomQuery], Code: INVALID_TYPE, Message:
(SELECT Id, Visit_Date__c from CVR__c WHERE LastModifiedDate >=
^
ERROR at Row:1:Column:49
Didn’t understand relationship ‘CVR__c’ in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the ‘__r’ after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.
However when I’m querying the above SELECT statements separately I’m getting results individually.
SELECT Id, Name FROM Account
SELECT Id, Visit_Date__c from CVR__c
These 2 queries working absolutely fine for me. It is my understanding that if there is an “__c” (underscore underscore) that means the object is custom object.
Do you recall what is the final query ? I am stuck at the same type of query with the same type of error. Workbench does not provide joining objects queries.
Thanks. I tried and also learnt that joining SQL queries and SOQL queries are totally different and we need to add __r which explains the relation between the tables.