I wrote a trigger on Contract, where I need to query all the related Quotes of contract. I wrote below query:
List<Quote> quotes = [Select ContractId From Quote Where ContractID IN: ids];
I get this error:
No such column 'ContractId' on entity 'Quote' ...
I tried to execute this query in Query Editor of Developer Console and as Anonymous apex. Both Worked. I also checked the permission for the field. In fact I can see the field on the Record's Page Layout.
What could be the problem?