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
Miles NashMiles Nash 

INVALID_FIELD No such column

Hi all,

I need a new field on Opportunity to handle an External ID.  Having looked at existing Custom Fields on my Opp, I have found one called Order_ID__c, which doesn't appear to have been used to date and fits my purpose.

I executed the following in the Query Editor in Developer Console for the Live environment:

SELECT Count(Id) FROM Opportunity WHERE Order_ID__c != null
and got the following response:
 
[object Object]: Count(Id) FROM Opportunity WHERE Order_ID__c != null ^ ERROR at Row:1:Column:41 No such column 'Order_ID__c' on entity 'Opportunity'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

When I execute this in Query Editor in my Sandbox for the same Org, I successfully receive a Query Result (0).  Any idea why this is happening?

Many thanks!
Amit Chaudhary 8Amit Chaudhary 8
My be you have Order_ID__c field in sandbox not in production. PLease check your production field API name. Make sure you have Order_ID__c field in production
Miles NashMiles Nash
Unfortunately, I've verified (by checking in Settings -> Customize -> Opportunities -> Fields) that the field exists in Production and that it has the same API name
Amit Chaudhary 8Amit Chaudhary 8
Please check field level access (FLS) for that field make sure field should be visible to you your profile (Like system admin).
Let us know if that will help you
João LimaJoão Lima
I was facing the same issue. Thanks for your help Amit.
Suresh Goud 75Suresh Goud 75
It's your Apex class version issue. Upgrade the class version will solve it
Ramu goswami 1Ramu goswami 1

SELECT Id,Name,Price__c,Packed__c,Quantity__c FROM
               ^
ERROR at Row:1: Column:16
No such column 'Price__c' on entity 'Camping_Item__c'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

can any suggest  where I am wrong 
AvinashNAvinashN
@Ramu goswami 1 , I was also facing same issue, I checked FLS, Profile level Object Setting, Permission Set level Object Access setting but not luck. At last I fugure Out that My Field was Lookup field means ultimately belonging to another object then I changed Delpoyment Status = Deployed for lookup object. And Issue resolved :)