• Rita Singh
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
In my application there is  a custom object related to the Product2. What I need is to fetch some fields of OpportunityLineItem  and  some fields of custom object which is related to Product2. I am executing the following queries : 
1. SELECT ID from RelatedCustomObject where Product2.Id IN (SELECT ProductID from OpportunityLineItem where OpportunityID = '123')
2. SELECT quantity from  OpportunityLineItem where OpportunityID = '123'

But in the scenerio where OpportunityLineItem has 7 records, out of which 2 uses same Product , the first query is eliminating the duplicate ones due to IN clause and giving results for the unique ones.But I need to fetch them all.Could anyone please suggest what can be done in this case?User-added image