+ Start a Discussion
Salesforce BlitzSalesforce Blitz 

No such column error while trying to use custom field in list and set.

list<Student__c> stnewlist=new list<Student__c>();
list<Student__c> stlist=[select id,name from Student__c where Sport__cid in:set2 ];

Error:  No such column 'Library__cid' on entity 'Sport__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.User-added image
Hi Jagadeesh,

   If Sport_c is relation field then just below should work.
  list<Student__c> stlist=[select id,name from Student__c where Sport__c in:set2 ];