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
PaulATPimptastiPaulATPimptasti 

No such column 'DeveloperName' on entity 'Document'

Dear All,

 

I have an odd problem.   I am trying to select a Document based upon its DeveloperName, however when I try to save my class I receive the following error.

 

"Error:Compile Error: No such column 'DeveloperName' on entity 'Document'. Ifyou are attempting to use a custom field, be sure to append the '__c'after the custom field name. Please reference your WSDL or the describecall for the appropriate names"

 

My select statement is:

 

"SELECT Id, Body FROM Document WHERE DeveloperName = 'Oversize_Attachment_Test'"

 

When running the SELECT statement from the IDE Schema Browser a record is returned without error. However when running the same select from an APEX Class I receive the above error.

 

Any ideas?

 

Paul 

Best Answer chosen by Admin (Salesforce Developers) 
PaulATPimptastiPaulATPimptasti

The class I created the code on was set to API version 17.  However I then copied the code to another class where the API version was set to 13.  I didn't check the API version as the properties of the Inbound Email Object that were released in v17 were referenced in the code and no errors were being reported so assumed it was a bug.

 

Chalking this one up to user error.

All Answers

ahab1372ahab1372
weird indeed. Did you try with different API versions? I suggest opening a case with sfdc support
PaulATPimptastiPaulATPimptasti

Hi Ahab,

 

It's very strange.  I raised the same case with Sf.com Premier Support on Monday but have not heard back from them. 

 

Haven't tried the different API version, but I need the new large email truncation features so I can't downgrade it to v16 or older.

 

When I hear back I'll post an update to the thread.

 

Paul 

PaulATPimptastiPaulATPimptasti

The class I created the code on was set to API version 17.  However I then copied the code to another class where the API version was set to 13.  I didn't check the API version as the properties of the Inbound Email Object that were released in v17 were referenced in the code and no errors were being reported so assumed it was a bug.

 

Chalking this one up to user error.

This was selected as the best answer