Reputation: 5698
I have custom object in my RemedyForce abc__c
and would like to get list of it.
Tried this code:
SearchResult sr = con.search(
"FIND {00008137} IN abc__c FIELDS RETURNING abc__c(Id, Name)");
but it returns
[InvalidSObjectFault [ApiQueryFault [ApiFault exceptionCode='INVALID_TYPE' exceptionMessage='sObject type 'abc__c' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names.'
Tried this code too and it returns:
String sql = "SELECT Id, Name FROM abc__c LIMIT 10";
QueryResult result = con.query(sql);
[InvalidSObjectFault [ApiQueryFault [ApiFault exceptionCode='INVALID_TYPE' exceptionMessage='sObject type 'abc__c' is not supported.'] row='-1' column='-1' ]]
Anyone can advise how to get list of my custom object?
Upvotes: 0
Views: 261
Reputation: 3748
Your code looks good. This exception can happen if the user making the request doesn't have a permission to the specified object.
Upvotes: 0