selectQuery not returning the correct values back using REST

Posted by IramK on 10-Jul-2015 11:01

Hello,

I am using selectQuery using REST API and it is not returning the values of the records I am expecting it to return. Basically I have a Many to Many relationship between object A (account) and object B (category). Now I am trying to get the related accounts for a particular category using selectQuery.

Example of the REST API call:

www.mydomain.com/rest/api/selectQuery?sessionId=12345&startRow=0&maxRows=100&query=select id from account where category = 39888


There are two accounts belonging to one category and I am expecting it to return the id's of the two records, however I get no records back from the selectQuery. On attaching further account records to my category record, I still notice that the selectQuery does not return any value. This happens when one account has more than one category assigned.

Is this a known issue with objects that have a Many-to-Many relationship between them or am I doing something wrong?

Posted by Anoop Premachandran on 14-Jul-2015 01:11

Hi IramK,

This is a documented limitation - documentation.progress.com/.../index.html

"A relationship (i.e. Lookup) field can be used, but will only take the ID of the first related record--not an array of all related records"

When the account has more than one category, querying this way will not work. We only store first value of category in the main account record.

All Replies

Posted by pvorobie on 10-Jul-2015 11:52

1. Please debug your query using Test Query tool

2. Please make sure that current user has View permissions for records you're trying to fetch

3. Please use URL encoding for "query" parameter in your call

Posted by IramK on 13-Jul-2015 03:28

[mention:05b5f00eae4a468d844fa8bedcafd110:e9ed411860ed4f2ba0265705b8793d05] : I am using SOAPUI to test this selectQuery call and the query parameters are URL encoded. The call is being made by an Administrator so the permissions are set properly.

Test Query tool: I've done the test Query tool test as well and its returning me no results where as in reality it should return one record ID back.

Posted by pvorobie on 13-Jul-2015 10:27

Please use "Test Query" tool to check your query.

Posted by Anoop Premachandran on 14-Jul-2015 01:11

Hi IramK,

This is a documented limitation - documentation.progress.com/.../index.html

"A relationship (i.e. Lookup) field can be used, but will only take the ID of the first related record--not an array of all related records"

When the account has more than one category, querying this way will not work. We only store first value of category in the main account record.

This thread is closed