Error when using FIELDS(STANDARD) in an Apex SOQL query : System.QueryException: No such column ‘EffectiveDate’ on entity ‘Quote’

I recently implemented the new FIELDS(STANDARD) functionality in Apex queries and I am using the following query now:

SELECT FIELDS(STANDARD), Custom1__c, ... , CustomN__c 
FROM Quote 
WHERE Id =: quoteId

However I’m getting the error No such column 'EffectiveDate' on entity 'Quote'. The odd thing is that it’s obviously a Standard field being queried in but the field itself doesn’t exist… Unless I’m missing something, I can’t seem to find it anywhere. Is it a field from another API version or is it something else? As a reference I’m using API v.51.

Any help would be appreciated! Let me know if I can add more information as well to help clarify my issue.

Edit:

As per request of @sfdcfox, I’ll try to create a Minimum Viable Reproduction of this scenario and edit my post if I can come up with one. In the meantime, here are a few more contextual points to help with troubleshooting:

The query technically has a few nested queries so it actually looks something like

SELECT FIELDS(STANDARD), 
       Custom_Field__c, 
      (SELECT FIELDS(STANDARD), 
              Custom_Field__c 
              FROM QuoteLineItems LIMIT 100), 
      (SELECT FIELDS(STANDARD), 
              Custom_Field__c 
              FROM ChildRecords__r LIMIT 100)
FROM Quote WHERE Id =: quoteId

This query is being ran inside a queued context (the very first action inside the queued context as well), and occurring after the creation of an Opportunity record.

Answer

Attribution
Source : Link , Question Author : Jacob Barazoto , Answer Author : Community

Leave a Comment