• Harting Harris
  • NEWBIE
  • 0 Points
  • Member since 2011
  • Principal Associate
  • Concretio Apps Pvt Ltd

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

Hi,


I am trying to display products from a custom pricebook Purchase in a custom controller.

I tried the following three queries and all of them are throwing compilation errors.
The three queries are : 

public  List<product2> pls=new List<product2>();
public price(){

 

//Queries to get the products and their prices from the purchase pricebook
//pls=[select Pricebookentry.unitprice,product2__r.name from pricebook2 where name='Purchase' ];
//pls=[select a.name,b.UnitPrice from product2 a,pricebookentry b,pricebook2 c where a.id=b.Product2Id and b.id=c.id and c.name='Purchase' ];
//pls=[select name,[select unitprice from pricebookentry where pricebook2id in[select id from pricebook2 where name='Purchase']] from product2 ];

 

Please help!