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
mbondmbond 

No such column 'Id'

Here's my code that's causing the error:

    	for(OpportunityLineItem oppLI : 
    			[SELECT Id
    			FROM OpportunityLineItem 
    			WHERE Opportunity.Account.Id = :AcctId]) {
 ...
   	}

 

Here's my error:

System.UnexpectedException: No such column 'Id' on entity 'OpportunityLineItem'. 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.

 

So if every entity has an 'Id' column, how can I get an error that the 'Id' column doesn't exist?  I've googled this and didn't find anything helpful.

 

Thanks for helping,

Matt

Best Answer chosen by Admin (Salesforce Developers) 
mbondmbond

I think this was a secondary error.  There was an error that happens right before this in the same trigger cascade.  Once I fixed that, I couldn't see this error anymore.

 

Matt

All Answers

joshbirkjoshbirk

Does Opportunity.AccountId work?

mbondmbond

I think this was a secondary error.  There was an error that happens right before this in the same trigger cascade.  Once I fixed that, I couldn't see this error anymore.

 

Matt

This was selected as the best answer