1

I am running a sample query in salesforce using jquery +Ajax but one of the query is giving me an error.

query:

select id from document__c where id not in (select entityid from topicassignment)

Kindly let me know the cause and resolution:

Error running the query: error,

Bad Request, [{"message":"Implementation restriction: TopicAssignment only allows security evaluation for non-admin users when either (1) LIMIT is specified and at most 1000 or (2) WHERE is specified and filter on Id or Entity","errorCode":"MALFORMED_QUERY"}]

3
  • 1
    please show your query as an edit to the post – cropredy Sep 10 '15 at 16:11
  • select id from document__c where id not in (select entityid from topicassignment) – cloudy-ritz Sep 10 '15 at 16:13
  • 4
    @riteshjaiswal The error message explains exactly your choices on how to fix this. More detail at the bottom of the TopicAssignment documentation. – Keith C Sep 10 '15 at 16:32
1

Free SOQL only allowed for Administrators which have "view all data" permission. Other wise you should restrict your query as:

  • Specify a LIMIT clause of 1,100 records or fewer.
  • Filter on Id or Entity when using a WHERE clause with "="

otherwise you will get the error

Bad Request, [{"message":"Implementation restriction: TopicAssignment only allows security evaluation for non-admin users when either (1) LIMIT is specified and at most 1000 or (2) WHERE is specified and filter on Id or Entity","errorCode":"MALFORMED_QUERY"}]

1
  • is there any way to find record with no topic except this query :: select id from ce_document__c where id not in (select entityid from topicassignment) – cloudy-ritz Sep 10 '15 at 19:14
1

Have you tried: [Select entityId from topicAssignment where entityId in (Select id from document__c) limit 1000]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.