function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
FluffyFluffy 

Why can't I query certain Salesforce tables ???

Hello,

I use java salesforce API and axis 2 , and stubs generated with xmlbeans option. I can execute queries on
most saleforce tables (72 of them). However, there are 8 tables which I cannot query
at all. These tables are: Name, NoteAndAttachment, EmailStatus,
OpenActivity,AdditionalNumber,ProcessInstanceHistory, Approval and ActivityHistory.

Whenever I try to query any of these tables with the API, I get the following exception:

<meta http-equiv="CONTENT-TYPE" content="text/html; charset=utf-8"><meta name="GENERATOR" content="OpenOffice.org 2.1 (Linux)"><meta name="AUTHOR" content="yana millis"><meta name="CREATED" content="20071210;9342400"><meta name="CHANGEDBY" content="yana millis"><meta name="CHANGED" content="20071210;12505100"> com.sforce.soap.enterprise.UnexpectedErrorFaultException: UnexpectedErrorFaultException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at java.lang.Class.newInstance0(Class.java:350)
at java.lang.Class.newInstance(Class.java:303 at
com.sforce.soap.enterprise.SforceServiceStub.query(
SforceServiceStub.java:4257)


When these same tables are queried with Perl API a more descriptive error is generated:
INVALID_TYPE_FOR_OPERATION: entity type does not support query

Its worth pointing out that these entities ARE in the wsdl file,
and they ARE being referenced by other tables, and I CAN call
describe() on them from the API, and all the correct fields and their
types are returned..

So, does anybody have any ideas why do these tables may not support
queries ? And what could I possibly do to debug this matter ?

Thanks ahead for any suggestions,


--Fluffy

PS. Apologies for cross-posting

SuperfellSuperfell
There are a number of consolidated view tables that are only queriable as child queries in a SOQL-R query, they're not queriable as top level tables. The queryable flag in the describeSObject call indicates this. (e.g. you can do select id, name, (select id, subject from OpenActivities) from account where name like 'f%', but not select id, subject from OpenActivities)
FluffyFluffy
Simon,
thanks a lot for your clarification !

regards,

Fluffy
CaraCara

I've found that I can't do this either, however for a work around the crystal database expert window will show you Stored Procedures.  The stored procedures list every report that has been created in SalesForce that you have access to.

I used the stored procedure report that queried the activity records and the data I was looking for was displayed. 

This is probably setup because Crystal will query the entire database first and then apply filters which will crash the database server.  (Past Experience/Lessons Learned). 

Create a report that pulls the data you are looking for on the activity screen.  Log into Crystal, use that stored procedure and link it to a table.  Then you can run the report as required.