How to filter for a object wiith a “value” and “name” in QBO api?
How to filter for a object wiith a “value” and “name” in QBO api?
It seems like its the api won't permit a query filter of the form:
select * from purchaseorder where APAccountRef.value='33'
In the case of purchase orders it seems to mean that I need to bring down every purchase order to my server and scan for the account I need which is highly suboptimal. Is there some other syntax for querying against the many attributes which have been encoded like
"APAccountRef":
"value": "33",
"name": "Accounts Payable (A/P)"
with just a name and value attribute?
1 Answer
1
If you refer to the documentation:
It gives you a list of all fields, and a list of fields that are filterable
. Your query is using a field that does not exist as part of Purchase Orders
:
filterable
Purchase Orders
AccountRef.value='39'
AccountRef.value='39'
The correct field is:
APAccountRef:
required
ReferenceType, filterable
Specifies to which AP account the bill is credited.
So your query should be:
SELECT * FROM purchaseorder WHERE APAccountRef = '39'
SELECT * FROM purchaseorder WHERE APAccountRef = '39'
I also tried SELECT * FROM PURCHASEORDERS WHERE APAccountRef.value='39' and get QyereyValidationError Property APAccountRef.value not found for Entity PurchaseOrder"
– user1023110
Sep 18 '18 at 0:29
I would report this to Intuit as a bug then. It should be a
filterable
field according to their documentation. You should be able to enter a support ticket from within your Intuit developer account.– Keith Palmer Jr.
Sep 18 '18 at 15:15
filterable
This has been fixed in the api now.
– user1023110
Oct 9 '18 at 0:14
Thanks for contributing an answer to Stack Overflow!
But avoid …
To learn more, see our tips on writing great answers.
Required, but never shown
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy
When I try APAccountRef='39' I get "Fault":"Error":["Message":"Invalid query","Detail":"QueryValidationError: property 'APAccountRef' is not queryable","code":"4001"],"type":"ValidationFault","time":"2018-09-17T17:20:32.057-07:00"
– user1023110
Sep 18 '18 at 0:20