2

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?

2 Answers 2

0

If the object is part of a managed package, it will have a namespace prefix. If the namespace is BMCServiceDesk, the object API name will be BMCServiceDesk__abc__c. This will apply to any custom fields within the object as well:

String queryString = 'SELECT Id, Name, BMCServiceDesk__Custom_Field__c'
    + ' FROM BMCServiceDesk__abc__c LIMIT 10';
1
  • Yes correct, actually the mistake is very silly. Please see my answer.
    – Rendy
    Commented May 18, 2015 at 3:35
0

Finally got this solved, actually the endpoint that is used in my application is wrong, that's why the custom object is not visible to logged-in user.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .