Skip to main content
added 1 character in body
Source Link
David Cheng
  • 7.4k
  • 18
  • 55
  • 89

As the error states, you cannot specify related fields in the inner SELECT statement -- you can only specify fields that are in the object itself.

There is a Product2Id field in the OpportunityLineItem object (see documentation) so you should be able to use this field:

SELECT ContentDocument.Id FROM ContentDocumentLink WHERE LinkedEntityId IN
(SELECT Product2Id FROM OpportunityLineItemsOpportunityLineItem WHERE OpportunityOpportunityId = '{pv0}')

As the error states, you cannot specify related fields in the inner SELECT statement -- you can only specify fields that are in the object itself.

There is a Product2Id field in the OpportunityLineItem object (see documentation) so you should be able to use this field:

SELECT ContentDocument.Id FROM ContentDocumentLink WHERE LinkedEntityId IN
(SELECT Product2Id FROM OpportunityLineItems WHERE Opportunity = '{pv0}')

As the error states, you cannot specify related fields in the inner SELECT statement -- you can only specify fields that are in the object itself.

There is a Product2Id field in the OpportunityLineItem object (see documentation) so you should be able to use this field:

SELECT ContentDocument.Id FROM ContentDocumentLink WHERE LinkedEntityId IN
(SELECT Product2Id FROM OpportunityLineItem WHERE OpportunityId = '{pv0}')
Source Link
David Cheng
  • 7.4k
  • 18
  • 55
  • 89

As the error states, you cannot specify related fields in the inner SELECT statement -- you can only specify fields that are in the object itself.

There is a Product2Id field in the OpportunityLineItem object (see documentation) so you should be able to use this field:

SELECT ContentDocument.Id FROM ContentDocumentLink WHERE LinkedEntityId IN
(SELECT Product2Id FROM OpportunityLineItems WHERE Opportunity = '{pv0}')