In the Anonymous Window of the developer console, I am attempting to execute the following:
System.debug(
JSON.serialize([
SELECT OpportunityLineItemSchedule.Revenue, OpportunityLineItemSchedule.ScheduleDate, OpportunityLineItemSchedule.OpportunityLineItem.TotalPrice, OpportunityLineItemSchedule.OpportunityLineItem.Opportunity.Id, OpportunityLineItemSchedule.OpportunityLineItem.Opportunity.CloseDate, OpportunityLineItemSchedule.OpportunityLineItem.Opportunity.Amount
FROM OpportunityLineItemSchedule
WHERE OpportunityLineItemSchedule.OpportunityLineItem.Opportunity.Amount != OpportunityLineItemSchedule.OpportunityLineItem.TotalPrice
])
);
I receive this error:
Line: 5, Column: 78
expecting a colon, found 'OpportunityLineItemSchedule.OpportunityLineItem.TotalPrice'
I understand this error typically pops up when one is attempting to use a variable in a query. However, I am not: I am using standard fields. Why am I receiving this error?
JSON.serialize()
instead (no idea on how to fix that if it is the case). Can you try debugging the query without serializing it?