[SalesForce] “No such column on entity” error for an existing custom field

I am trying to run a simple SOQL on a custom object:

SELECT Id, Course_Link__c
FROM Course__c

But instead I am getting an error saying:

SELECT Id, Course_Link__c
^ ERROR at Row:1:Column:12 No such column 'Course_Link__c' on entity 'Course__c'…

I checked this field in the Setup section for this object and surprisingly see it there. I event copy-pasted the API name of the field and re-run the query, but still saw no effect.
setup section for Course__c

When I checked this fields in the Developer Console (Ctrl + Shift + O > Look Up Course.obj), I found that Course_Link__c was missing:

developer console

Does anybody know why the Course_Link__c field is not recognized by Developer Console? In general, why Salesforce exposes such strange behavior?

Best Answer

Make sure that this field is actually visible to your user via Field Level Security.

  1. Click the field name in your Setup UI to view the field definition detail.
  2. On this detail view, there will be a Set Field-Level Security button.
  3. Make sure Visible is selected for your Profile.
Related Topic