Skip to main content
  List<OpportunityLineItem> t prod=[SELECT Id, Name,(SELECT Quantity, UnitPrice, TotalPrice,PricebookEntry.Name, PricebookEntry.Product2.Family FROM OpportunityLineItems) FROM OpportunityLineItems WHERE ParentId = :oppName.Id];

 

But getting error :  Compile Error: Invalid type: OpportunityLineItems at line 12 column 5
27 个回答
  1. 2018年7月10日 06:58
    Use this query

     

    list<OpportunityLineItem> tprod=[SELECT Name,Quantity, UnitPrice, TotalPrice,PricebookEntry.Name, PricebookEntry.Product2.Family FROM OpportunityLineItem WHERE OpportunityId = :oppName.Id];

     

    And to display the details you are using a Product2 that's why you are getting the errors. Use OpportunityLineItem.
0/9000